Hi All, 

I'm really new to this (yesterday) and I've followed a tutorial. I'm just 
wondering if there is a simple way to make  letters or numbers appear over 
my pins? I have a list of suppliers and want to indicate them on the map 
with a letter or number. with the address when you click the pin. 

I'm think along the lines of a string in the marker options? - heres my 
code. 

Please can you help 

Rebecca

//Google Map//
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;
import com.google.maps.InfoWindowOptions;
import com.google.maps.MapMouseEvent;
import com.google.maps.styles.FillStyle;
import com.google.maps.styles.StrokeStyle;
 
// Create The Map
var map:Map = new Map();
map.key = 
"ABQIAAAAHnTxrW35iwO7TUyb5DVSlRQxwGfbL6iJ0RFbppF_-QJlM0HZohRurIf7OmFH21CL0s2xiRXkLddrmA";
map.setSize(new Point(275, 300));
map.x = 450;
map.y = 25;
map.addEventListener(MapEvent.MAP_READY, onMapReady);
this.addChild(map);
 
function onMapReady(event:MapEvent):void {
  map.setCenter(new LatLng(53.595024,-2.297151), 9, 
MapType.NORMAL_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({ 
   strokeStyle: new StrokeStyle({color: 0x8700af}),
                 fillStyle: new FillStyle({color: 0x5f875f, alpha: 0.8}),
                                                           hasShadow: true,
                                                           tooltip: ""+tip  
                                                           })
                                         );
               i.addEventListener(MapMouseEvent.CLICK, 
function(event:MapMouseEvent):void
                                                                            
  {
                                                                            
  map.openInfoWindow(event.latLng, new InfoWindowOptions({
                                                                            
                                                         titleHTML: 
""+myTitle, 
                                                                            
                                                         contentHTML: 
""+myContent
                                                                            
                                                         }));
                                                                            
                                              
                                                                            
  });
               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"));
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-maps-api-for-flash+unsubscr...@googlegroups.com.
To post to this group, send email to google-maps-api-for-flash@googlegroups.com.
Visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to