Friday, March 29, 2013

How to display current location on the Map (using the iOS Simulator)

If this is the first time that you are using the iOS Simulator to display a map, chances are that the simulator still needs to be setup with an initial location/position. To do that follow these steps:

  1. First get your current location, go to http://maps.google.com
  2. Click the link icon and grab the co-ordinates:
  3. In the iOS Simulator, click the menu links Debug > Location > Custom Location...
  4. Enter the co-ordinates, and click OK.
  5. The map in your application should now be showing the blip icon (the blue current position icon) in the custom location that you just specified. Thats it.

    For future applications the iOS Simulator remembers this location.
  6. One more point to remember, when you had dragged the Map View control onto the story board, at that time you should setup the properties of the Map View and ensure that Show User Location checkbox is checked, as shown below:

No comments:

Post a Comment