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. 

-- 
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-api-v3+unsubscr...@googlegroups.com.
To post to this group, send email to google-maps-js-api-v3@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 via email to