Question

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 addAnnotation:pin] in loop, each time updating coordinates but it is not working.

Please help in this regard.

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top