iphone - How to show multiple route IOS Mapview -
i creating ios application map based application in app show route/path between source , destination , have done show 1 route/path. show possible path between source , destination google map. illustrate idea have added screenshot show path this. there sample this?
thanks in advance
follow these simple steps :
- get 2 input locations.
- use method
-geocodeaddressstring: completionhandler:
of geo coder class (from core location framework) getting coordinates given location string. - use
mkpointannotation
object creating annotation on locations in map. - send request google api getting direction between 2 locations.
- as of google api response (available in both json & xml) have
overview_polyline
object, has array of location coordinates. encoded, have use correct decoding module latitude , longitude. decoded location coordinates can create poly lines usingmkpolyline
instance method.mkpolyline *polyline = [mkpolyline polylinewithcoordinates:coordinates count:[overlaypoints count]]; [mapview addoverlay:polyline];
- now polyline have been drawn on map still not visible final go have override
-viewforoverlay
method displaying poly line view. - if still have confusions can check tutorials.
Comments
Post a Comment