/ Published in: ActionScript 3
Just a simple example script for populating a bunch of MapMarker objects on a Map using the distriqt NativeMaps ANE
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var markerData:Array = [ { id: -1, name: "myMarker1", title: "marker 1", info: "", location: new LatLng(-37, 144) }, { id: -1, name: "myMarker2", title: "marker 2", info: "", location: new LatLng(-37, 145) }, { id: -1, name: "myMarker3", title: "marker 3", info: "", location: new LatLng(-37, 146) }, { id: -1, name: "myMarker4", title: "marker 4", info: "", location: new LatLng(-37, 147) } ]; for (var i:int = 0; i < markerData.length; i++) { var marker:MapMarker = new MapMarker(); marker.name = markerData[i].name; marker.setPosition( markerData[i].location ); marker.title = markerData[i].title; marker.info = markerData[i].info; // This stores a reference in our marker data array to the // ID of the marker which is returned by the addMarker() method markerData[i].id = NativeMaps.service.addMarker( marker ); }