Dropping Multiple Pins On Map given Co-ordinates Mapkit 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
精彩评论