0

Title says it all. I've been trying create an app that uses a user defined area for a calculation. The user area is going to be created by taking in points that the user taps on a map. I've gotten as far as finding and zooming into the user's location, and switching from normal to satellite, but I cannot figure out how to set points for the polygon.

Basically I need to

1) Get a coordinate (longitude, latitude) from a tap

2) Create a moveable object on that coordinate

3) Use the object's coordinates to create a polygon

Currently I'm stuck on (Get a coordinate from a tap) which is harder than it seems. If anyone could help or just point me in the right direction I'd be very grateful.

  • Found this to be very helpful in creating moveable annotations http://sweettutos.com/2015/04/24/swift-mapkit-tutorial-series-how-to-search-a-place-address-or-poi-in-the-map/ – Daniel Cleary Jan 30 '16 at 02:50

1 Answers1

0

1) Get a coordinate (longitude, latitude) from a tap Get the coordinates of a point from mkmapview on iphone

2) Create a moveable object on that coordinate - Create draggable MKAnnotation

3) Use the object's coordinates to create a polygon - Draw MKPloygon with annotation as center coordinate.

Community
  • 1
  • 1
slonkar
  • 4,055
  • 8
  • 39
  • 63