1 Reply Latest reply on Jun 22, 2011 3:47 PM by siguva78

    Google Maps Flash API MarkerOptions Fillstyle

    siguva78

      I am trying to pass a variable (mapcolor) into my createMarker function to create a marker with a color specific to a particular person. Google does not comply though, and just defaults to the red fillstyle. Please see my code below. Thank you for your help!

       

      private function createMarker(latlng:LatLng, markerheader:String, markercontent:String, mapcolor:String):Marker 
              {
                  var marker:Marker = new Marker(latlng,
                      new MarkerOptions(
                      {
                          strokeStyle: new StrokeStyle({color: mapcolor}),
                          fillStyle: new FillStyle({color: 0xC8C8FE, alpha: 0.8}),
                          radius: 6,
                          hasShadow: false
                      }));
      
                  marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void {
      
                      markerheader = "<b>" + markerheader + "</b>";
                      map.openInfoWindow(latlng, new InfoWindowOptions({titleHTML: markerheader, contentHTML: markercontent}));
                  });
                  return marker;
              }