Two (Objective-C) examples of displaying geometric shapes on MKMapView in iOS3 are:
- Drawing polyines or routes on a MKMapView by Craig Spitzkoff, which shows how to draw a line on a map from a file of latitude/longitude points.
- Drawing a Point, Line, Polygon on top of MKMapview by Rupert, which builds on the previous example to allow drawing your own lines/polygons on a map.
I put together a class diagram to try and explain how they work (the classes shown are from the 2nd example, which allows you to draw your own shape).
Please remember all the hard work here has been done by the original authors. All credit goes to them. Any bugs in the MonoTouch code are mine... let me know if you find any.
iOS4 examples to follow...
hey mate,
ReplyDeleteJust to let you know that I created DrawMap2.zip which is the SAME codebase but compiled under iOS4. Here's the new link
http://www.gisnotes.com/wordpress/2010/08/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/
Anyway, thanks for porting this to MonoTouch! :)
cheers,
rupert