|
package {
import flash.display.Sprite;
import flash.display.StageScaleMode;
import com.mapquest.tilemap.*
import com.mapquest.tilemap.controls.inputdevice.*;
import com.mapquest.tilemap.controls.shadymeadow.*;
public class AS3Map extends Sprite {
var zs:ZoomSettings;
var map:TileMap
public function AS3Map():void {
//turn scaling off
this.stage.scaleMode = StageScaleMode.NO_SCALE;
//create a new TileMap object, passing your platform key
map = new TileMap("Fmjtd%7Cluurn96rnl%2Cra%3Do5-9w80lr");
//set the size of the map
map.size = new Size(stage.stageWidth, stage.stageHeight);
//add the map to the sprite
addChild(map);
addMapCenterF();
addControlsF();
}
private function addMapCenterF():void{
//set the map center
map.setCenter(new LatLng(38.895,-77.036697),8);
}
private function addControlsF():void{
//add a control to the map
map.addControl(new SMLargeZoomControl());
//make a zoomSettings object
this.zs = new ZoomSettings();
this.zs.animate = true;
this.zs.easeFunction = mx.effects.easing.Linear.easeInOut;
//add the mousewheelzoomcontrol to the map
map.addControl(new MouseWheelZoomControl());
}
}
}
|