flash on 2011-3-7

by kikiroom
♥0 | Line 40 | Modified 2011-03-07 22:35:57 | MIT License
play

ActionScript3 source code

/**
 * Copyright kikiroom ( http://wonderfl.net/user/kikiroom )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7pln
 */

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:maps="com.google.maps.*" width="100%" height="100%">
<mx:Style>Application {fontFamily: Arial, "ms pgothic"; fontSize: 13px; paddingTop: 0; paddingLeft: 0; paddingRight: 0; paddingBottom: 0;}</mx:Style>
<mx:Script>
<![CDATA[
import com.google.maps.LatLng;
import com.google.maps.LatLngBounds;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapMouseEvent;
import com.google.maps.MapType;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.InfoWindowOptions;
import flash.events.Event;
public var latPM:Number;
public var lngPM:Number;
public var descPM:Object;
public function onMapReady(event:Event):void {
  map.removeMapType(MapType.HYBRID_MAP_TYPE);
  map.removeMapType(MapType.PHYSICAL_MAP_TYPE);
  map.addControl(new MapTypeControl());
  map.enableScrollWheelZoom();
  map.enableContinuousZoom();
  latPM = Application.application.parameters.lat;
  lngPM = Application.application.parameters.lng;
  descPM = Application.application.parameters.desc;
  var latlng:LatLng = new LatLng(latPM, lngPM);
  var marker:Marker = new Marker(latlng);
  marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void {
    marker.openInfoWindow(new InfoWindowOptions({contentHTML:descPM, width: 180}));
  });
  map.addOverlay(marker);
  map.setCenter(latlng, 14, MapType.NORMAL_MAP_TYPE);
}
]]>
</mx:Script>
<maps:Map id="map" sensor="false" mapevent_mapready="onMapReady(event)" width="100%" height="100%"/>
</mx:Application>