0

I created 100 annotations using this code :

CLGeocoder().geocodeAddressString("Trieste, Via Svevo", completionHandler: {(placemarks, error)->Void in
  if error == nil {
    placemark = placemarks[0] as CLPlacemark

    self.puntoCercato2.coordinate = placemark.location.coordinate
    self.puntoCercato2.title = "Fermata di Via Svevo"
    self.puntoCercato2.subtitle = "1-8-29-B"
    self.myMap.addAnnotation(self.puntoCercato2)

  }else{
    println("2")
  }
})

iOS 8 all pins are show [1]: https://i.stack.imgur.com/eh8Le.jpg

iOS 7 only the first 50 [2]: https://i.stack.imgur.com/g8m7j.jpg

Why??

  • You now have enough rep to inline your images. Please do so. Actually, please inline NEW ones, don't use your phone to take a snap of the screen, take a screen shot of the simulator and use that, much easier on our eyes. And welcome to StackOverflow! – Paul Cezanne Mar 26 '15 at 17:30
  • The code shown doesn't "create 100 annotations". Is it being called in a loop? Show the real code that creates all the annotations. Geocoding can fail if called too frequently. See http://stackoverflow.com/a/24838347/467105. By the way, you can use Cmd+S to take a screenshot of the simulator. –  Mar 26 '15 at 17:30
  • are 200 loops. how can I do ? – Massimiliano Allegretti Mar 26 '15 at 17:35
  • If this is a hard-coded list of places, you should find the coordinates yourself **once** (manually or automatically) and hard-code them into the app as well. Don't geocode them every time at run-time. –  Mar 26 '15 at 18:26
  • With the code you already have. Have it println the coordinates to the console and capture the results and keep re-running until you have all 200. Then take the results and hard-code them and remove the geocoding code. –  Mar 26 '15 at 19:46

1 Answers1

0

I think we need more code to understand what's the issue there. Please edit your question with more details about the CLPlaceMarks. In the posted snippet you're adding only one placemark, that is the 0th position of the placemarks array. How do you create the array?

zerbfra
  • 190
  • 12