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?enter image description here

thanks in advance

follow these simple steps :

  1. get 2 input locations.
  2. use method -geocodeaddressstring: completionhandler: of geo coder class (from core location framework) getting coordinates given location string.
  3. use mkpointannotation object creating annotation on locations in map.
  4. send request google api getting direction between 2 locations.
  5. 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 using mkpolyline instance method. mkpolyline *polyline = [mkpolyline polylinewithcoordinates:coordinates count:[overlaypoints count]]; [mapview addoverlay:polyline];
  6. now polyline have been drawn on map still not visible final go have override -viewforoverlay method displaying poly line view.
  7. if still have confusions can check tutorials.

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -