distriqt NativeMaps AS3 API-填充多个标记示例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了distriqt NativeMaps AS3 API-填充多个标记示例相关的知识,希望对你有一定的参考价值。
Just a simple example script for populating a bunch of MapMarker objects on a Map using the distriqt NativeMaps ANE
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 ); }
以上是关于distriqt NativeMaps AS3 API-填充多个标记示例的主要内容,如果未能解决你的问题,请参考以下文章