Hi,
I am trying to set LatLng via flashVars. First I used this demo
http://code.google.com/apis/maps/documentation/flash/demogallery.html?searchquery=permalink&classname=
using fixed coordinates and worked fine, but when I tried to set them
externally the map did nothing.
Can anyone please point me what's wrong?
I hope someone can help me. Thanks in advance!
This is my invocation code:
<object type="application/x-shockwave-flash" data="gmapsflashvars.swf?
latlng=9.931805,-84.014925&zoom=19&maptype=roadmap" width="608"
height="349">
and this is my as3 code (I'm using Flash CS4):
// code start
import flash.display.MovieClip;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.google.maps.MapAction;
import com.google.maps.LatLng;
import com.google.maps.services.ClientGeocoder;
import com.google.maps.services.ClientGeocoderOptions;
import com.google.maps.services.GeocodingEvent;
import com.google.maps.services.Placemark;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.overlays.GroundOverlay;
import com.google.maps.overlays.GroundOverlayOptions;
import com.google.maps.overlays.OverlayBase;
import com.google.maps.overlays.EncodedPolylineData;
import com.google.maps.overlays.Polygon;
import com.google.maps.overlays.PolygonOptions;
import com.google.maps.overlays.Polyline;
import com.google.maps.overlays.PolylineOptions;
import com.google.maps.overlays.TileLayerOverlay;
import com.google.maps.controls.ZoomControl;
import com.google.maps.controls.PositionControl;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.OverviewMapControlOptions;
import com.google.maps.styles.BevelStyle;
import com.google.maps.styles.ButtonFaceStyle;
import com.google.maps.styles.ButtonStyle;
import com.google.maps.styles.FillStyle;
import com.google.maps.styles.GradientStyle;
import com.google.maps.styles.RectangleStyle;
import com.google.maps.styles.StrokeStyle;
var map:Map = new Map();
map.key =
"ABQIAAAAzihm3cVohf3Po9jvKXB3rhQw4dGw43ydV5qfsLX0Ew0JDjCMWBSxJFVXzkEX4JrLZKjW0oA2zqaIbA";
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
map.addEventListener(MapEvent.MAP_READY, onMapReady);
map.addControl(new ZoomControl());
map.addControl(new PositionControl());
map.addControl(new MapTypeControl());
this.addChild(map);
function onMapReady(event:Event):void {
var mapTypesMap:Object = {"roadmap": MapType.NORMAL_MAP_TYPE,
"satellite":
MapType.SATELLITE_MAP_TYPE,
"hybrid": MapType.HYBRID_MAP_TYPE};
var key:String;
var val:String;
var flashVars:Object = LoaderInfo(this.root.loaderInfo).parameters;
this.map.setCenter(new LatLng[(flashVars["latlng"])], Number
(flashVars["zoom"]), mapTypesMap[(flashVars["maptype"])]);
}
// code end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---