1
我是鈦工作室的初學者。我可以打開一個mapview並且可以製作一個註釋。如何在給定的緯度和經度的地圖視圖上進行多個註釋?提前致謝。鈦 - 做出多個註釋
我是鈦工作室的初學者。我可以打開一個mapview並且可以製作一個註釋。如何在給定的緯度和經度的地圖視圖上進行多個註釋?提前致謝。鈦 - 做出多個註釋
您可以使用循環進行多個註釋。
假設有一個我收到無效類型傳遞給函數具有數據數組元素{緯度,經度,標題}
var annotations = [];
for (var i = 0 ; i<data.length; i++) {
// this section will create annotations and add them on the mapview
var pin = Titanium.Map.createAnnotation({
latitude:this.data[i].latitude,
longitude:this.data[i].longitude,
title:this.data[i].title,
animate:true
});
annotations[i] = pin;
// suppose mapView is your map object
mapView.addAnnotation(annotations[i]);
}
。預計:NSDictionary,是:__NSArrayM in - [TiMapView annotationFromArg:](TiMapView.m:96)error – Maulik
你的代碼是什麼? –
它現在解決了:D代碼在這裏http://stackoverflow.com/questions/9128566/how-to-show-multiple-annotations-on-map – Maulik