简体   繁体   中英

How to draw shape in MKMapView?

I am going to develop a real estate app using xcode storyboard.

It has the map search function with selections in the map.

So i must draw a shape on the map and get the points of the shape.

And I must convert the point to coordinates.

How can i do this?

If this is impossible, is there any way to user other map view in iphone app?

I will be very grateful if anyone helps me.

You can take the advantage of overlay. There is apple's built in Class MKOVerlayView using this you can achieve it. Before adding actual overlay over the map if you want to handle drawing in your custom view then you have to take care about Google logo, It should not be hidden otherwise apple's rules will be violated. Once user complete drawing over your custom view just convert all points to map points(ie There is method in library not sure name of it) and whole drawing as built in overlayview on map. There are some built in overlay views are also exist like MKShape, MKPolyline etc. You can go here to check all about this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM