开发者

Dropping Multiple Pins On Map given Co-ordinates Mapkit iPhone

开发者 https://www.devze.com 2022-12-15 11:36 出处:网络
I have a query regarding Dropping Multiple Pins On Map when Co-ordinates are given using Mapkit in iPhone.

I have a query regarding Dropping Multiple Pins On Map when Co-ordinates are given using Mapkit in iPhone.

Using Mapkit I am able to see the map at given latitude and longitude. I am also able to drop a pin on one particular location.

However I have a array of lat and long and I want to show pins for them all. How to achieve this?

I tried adding [mapView addAnnot开发者_运维问答ation:pin] in loop, each time updating coordinates but it is not working.

Please help in this regard.


Do not using [mapView addAnnotation:pin] in loop,you can use this API: [mapView addAnnotations:pinsArray]. It works for me.

This is a screenshot of my App using multiple pins : Nearby Dovebox http://dovebox.l99.com:81//Home_files/screenshots/Nearby.png


You can do so by a simple logic.

call annotation method in a loop from 0 to your [array count]; you must pass arguments to annotation method ie id, lat and long.

i have done it successfully..

make sure you have include pinmark nsobject class

Aamir

0

精彩评论

暂无评论...
验证码 换一张
取 消