Hi!

I created a Google Map with javascript and it all worked fine. Now i'm
traying to make the same map on Flash (without Flex) and i'm having
some problems:

- Can't change the default market icon;
- OpenInfoWindow doesn't work when i click on the markers;

Here is the Actionscript code:

import com.google.maps.Map;
import com.google.maps.LatLng;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.google.maps.MapMouseEvent;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.ZoomControl;
import com.google.maps.controls.PositionControl;
import com.google.maps.InfoWindowOptions;
import com.google.maps.styles.FillStyle;
import com.google.maps.styles.StrokeStyle;

var map:Map = new Map();
map.key = "my key";
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
map.addEventListener(MapEvent.MAP_READY, onMapReady);
this.addChild(map);

function onMapReady(event:Event):void {
        map.setCenter(new LatLng(39.600000,-8.110685), 6,
MapType.NORMAL_MAP_TYPE);
        map.addControl(new ZoomControl());
        map.addControl(new PositionControl());
        map.addControl(new MapTypeControl());

        var myOptions:MarkerOptions = new MarkerOptions({
          tooltip: "This is a marker",
          hasShadow: true,
          clickable: true,
          draggable: false,
          gravity: 0.5
        });

        // Create a marker with an info window thats completely customized
        function createMarker(mlat, mlng, mloja) {
                var marker = new Marker(new LatLng(mlat, mlng), myOptions);
                marker.addEventListener(MapMouseEvent.CLICK,
function(e:MapMouseEvent):void {;
                var myTitle:String = "<b>" + mloja + "</b>";
                var myContent:String = "test";
                map.openInfoWindow(marker, new InfoWindowOptions({titleHTML:
myTitle, contentHTML: myContent}));
                });
                map.addOverlay(marker);
        }

        createMarker(38.74185, -9.23267, "Amadora");
        createMarker(41.18145, -8.65833, "Matosinhos");
}

Please help me. Can't find the solution to this problems on the Flash
API documentation.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to