google map marker disappear when embedded into flex project

139 views
Skip to first unread message

Yang Harry

unread,
Oct 22, 2017, 6:37:43 PM10/22/17
to Google Maps JavaScript API v3
Hi All,

I use google map api to show marker in single html file。 In the browser, I can see the marker which I added, but when the html is embedded into flex project, the marker disappears.

add marker method in the html file: xxxxxx.html 
function add_marker(Lat, Lng, title, content)
{
 
var Lat = arguments[0] ? arguments[0] : 23.799732;
 
var Lng = arguments[1] ? arguments[1] : 121.072728;
 
var MarkerLatlng = new google.maps.LatLng(Lat, Lng);
 
 
var infowindow = new google.maps.InfoWindow({
  content
: "<h4>"+ title +"</h4><br />"+content
 
});


 
var marker = new google.maps.Marker({
  position
: MarkerLatlng,
  map
: map,
  title
: title,
  visible
: true
 
});
 
 google
.maps.event.addListener(marker, 'click', function() {
 infowindow
.open(map,marker);
 
});
 
}


the flex project, embed xxxxxx.html method:
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
   
xmlns:s="library://ns.adobe.com/flex/spark"
   
xmlns:mx="library://ns.adobe.com/flex/mx"
   
width="100%" height="100%" creationComplete="init()" >
 
<fx:Declarations>


 
</fx:Declarations>
 
<fx:Script>
 <![CDATA[
 
 import mx.controls.Alert;
 import flash.external.ExternalInterface;  
 
 public function render(location:Array,issueID:int,issueDesc:String):void
 {
 if(mapHtml.htmlLoader.window.render(location,issueID, issueDesc))
 Alert.show("call error");
 }
 ]]>
 
</fx:Script>
 
<mx:HTML id="mapHtml" location="xxxxxx.html " width="100%" height="100%"/>
</mx:Canvas>


I wish anyone could help me, thank you so much. 

Frank McGuire

unread,
Feb 22, 2018, 4:52:40 PM2/22/18
to Google Maps JavaScript API v3
Hello,
I am experiencing the same problem ... since last week when there was a Google Maps API update from 3.2 to 3.3.
Did you ever find a solution? I have tried everything.
I have several maps and one map uses markerclusterer.js. 
That one displays the cluster markers fine but also does not the show the standard red markers.
None of my Flex.HTML maps show the standard red markers.
Please let me know ASAP.
Thanks 

Blagoja Chavkoski

unread,
Feb 23, 2018, 2:55:53 AM2/23/18
to google-map...@googlegroups.com
Hi, i have the same problem with markers. Add remove of marker dosent work always. I checked with custom overlay, and it works...

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-a...@googlegroups.com.
To post to this group, send email to google-map...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-maps-js-api-v3.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages