Map Bridge API Reference | Google Maps API for Flash Reference
This library provides a JavaScript proxy library to Google Maps API for Flash using Adobe's FABridge and project SWFObject.
mapbridge.js
or
mapbridge_packed.js
in your document header. Download the scripts's src folder's all files and put
it on your site and reference them in your site.
<script src="/path/to/mapbridge_packed.js?key=your_gmaps_api_key" type="text/javascript"></script>
MapBridge.createMap
static method to create a map instance. Get reference to
the map from the callback function's first parameter.
var map;
function init(){
MapBridge.createMap(document.getElementById('map_canvas'), function(m){
map = m;
// start working with map
}
}
obj.addEventListener(eventName, function(e){})
to handle events, and the actual event will be passed into the handler function.
, and an event object is passed in handler instead of individual values.
Refer to AS3 API docs for details about what object can trigger what event, and
what property is available in events.
map.addEventListener('mapevent_mappreinitialize', function(evt){
//work on evt object's properties
...
});
MapBridge.createMap method.
var latlng = new LatLng(23, 45);
var timer = map.create('flash.utils.Timer',[1000,1]);
var attitude = map.getAttitude();
var pitch = attitude.getPitch(); // not attitude.pitch;
attribute.setYaw(40);// not attitude.yaw = 40;
map.setMapType(MapType.HYBRID_MAP_TYPE()); // not MapType.HYBRID_MAP_TYPE;
map.addListener('mapevent_mapready', function (e){});
// or
map.addListener(MapEvent.MAP_READY(), function (e){});
var latlng1 = new LatLng(map1, 35, -80);
var latlng2 = new LatLng(map2, 35, -80);
map1.setMapType(MapType.HYBRID_MAP_TYPE(map1));
MapBridge.createMap(node, callback, opts) .
See example page.