are you receiving an error message? what exactly seems to be the problem? On Nov 14, 7:51 pm, "[email protected]" <[email protected]> wrote: > So I am doing something wrong. I am trying to load my marker points > from an xml file. My code I am using is below and the xml file > information is below that. Does anyone see what I am doing wrong? I > cant figure it out :(. Thanks in advance > > import com.google.maps.LatLng; > import com.google.maps.Map; > import com.google.maps.MapEvent; > import com.google.maps.MapType; > import com.google.maps.controls.ZoomControl; > import com.google.maps.controls.PositionControl; > import com.google.maps.controls.MapTypeControl; > import com.google.maps.overlays.MarkerOptions; > import com.google.maps.overlays.Marker; > > // Create the Map > var map:Map = new Map(); > map.key > = > "ABQIAAAAEgLnua8goqh9SHpBm0HzMxS6GkpI6y2BT5JgXrFnA2uScy57ABTSJJDprOAVYfqXO8HLAyimfXK8AQ"; > map.sensor = "true" > map.setSize(new Point(stage.stageWidth, stage.stageHeight)); > map.addEventListener(MapEvent.MAP_READY, onMapReady); > this.addChild(map); > > function onMapReady(event:MapEvent):void { > map.setCenter(new LatLng(47.360657,-120.60791), 6, > MapType.HYBRID_MAP_TYPE); > map.addControl(new ZoomControl()); > map.addControl(new PositionControl()); > map.addControl(new MapTypeControl()); > xmlLoader(); > > } > > function xmlLoader(){ > function loadXML(e:Event):void{ > XML.ignoreWhitespace = true; > var map_xml:XML = new XML(e.target.data); > > for (var i:Number = 0; i < map_xml.location.length(); i++){ > > var latlng:LatLng = new LatLng(map_xml.location[i].lat, > map_xml.location[i].lon); > var tip = map_xml.location[i].name_tip; > var myTitle:String = map_xml.location[i].title_tip; > var myContent:String = map_xml.location[i].content_tip; > > map.addOverlay(createMarker(latlng,i, tip, myTitle, myContent)); > > }// end of for loop > > // Add Markers On The Map > function createMarker(latlng:LatLng, number:Number, tip, myTitle, > myContent):Marker { > var i:Marker = new Marker( > latlng, > new MarkerOptions({ > hasShadow: true, > tooltip: ""+tip}) > > ); > return i; > > }// end function createMarker > }// end of loadXML function > > var xmlLoader:URLLoader = new URLLoader(); > xmlLoader.addEventListener(Event.COMPLETE, loadXML); > xmlLoader.load(new URLRequest("xml.xml")); > > } > > XML File > > <?xml version="1.0" encoding="utf-8" ?> > > - <map_xml> > > - <location> > > <lat>47.161036</lat> > > <lon>-122.284983</lon> > > <name_tip>Bradley Lake Park</name_tip> > > - <title_tip> > > - <![CDATA[ > Bradley Lake Park > ]]> > </title_tip> > > - <content_tip> > > - <![CDATA[ > Majanicho is a very good surf spot for longboarding it offers very long > rides. > ]]> > </content_tip> > </location> > > - <location> > > <lat>47.614342</lat> > > <lon>-122.209678</lon> > > <name_tip>Meydenbauer Beach Park</name_tip> > > - <title_tip> > > - <![CDATA[ > Meydenbauer Beach Park > ]]> > </title_tip> > > - <content_tip> > > - <![CDATA[ > La Derecha de los Alemanes is another very good spot for longboarders > but shortboarders will have some epic days out here to. > ]]> > </content_tip> > </location> > > - <location> > > <lat>47.599044</lat> > > <lon>-122.209198</lon> > > <name_tip>Chism Beach Park</name_tip> > > - <title_tip> > > - <![CDATA[ > Chism Beach Park > ]]> > </title_tip> > > - <content_tip> > > - <![CDATA[ > La Derecha de los Alemanes is another very good spot for longboarders > but shortboarders will have some epic days out here to. > ]]> > </content_tip> > </location> > </map_xml>
-- You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en.
