topical media & game development
actionscript-map-live-map.mx
actionscript-map-live-map.mx
[swf]
flex
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="onCreationComplete(event)" width="100%">
<mx:Script>
<![CDATA[
import com.afcomponents.umap.gui.*;
import com.afcomponents.umap.core.UMap;
import com.afcomponents.umap.types.LatLng;
import mx.core.UIComponent;
private var map:UMap;
public function onCreationComplete(event:Event) : void
{
var ref:UIComponent = new UIComponent();
map = new UMap(); // default: com.afcomponents.umap.providers.microsoft
map.setCenter(new LatLng(52.33313628963941, 4.865913391113281), 12);
map.setZoom(14); // explicit
map.setSize(this.width, this.height);
ref.addChild(map);
mapCanvas.addChild(ref);
ref.focusManager.deactivate();
map.addControl(new MapTypeControl());
map.addControl(new ZoomControl());
map.addControl(new PositionControl());
}
]]>
</mx:Script>
<mx:VBox>
<mx:Canvas id="mapCanvas" width="100%" height="100%" backgroundColor="#352D69" x="6" y="10"/>
</mx:VBox>
</mx:Application>
(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.