1

I am working on an app where I give direcctions in a country. Directions in that country is not available from apple so i decided to use google api on an apple map. However as you can see from my sceenshot. Although I find the location on my iphone mmap i just get straight lines versus following the route that google does.

Does this have anything to do with using google API on Apple Maps? I have no reason why this is happening.

enter image description here

this is the link I pass to the web from my app

http://maps.googleapis.com/maps/api/directions/json?origin=15.299503,-61.387292&destination=Rosalie+Bay+Resort,+Rosalie,+Saint+David+Parish,+Dominica&sensor=true

Sleep Paralysis
  • 449
  • 7
  • 22
  • How are you creating the Polylines to draw on the map? If you are using the Google Maps API, I would recommend using Google Map views instead of Apple. – Chris Truman Jan 13 '15 at 22:45
  • ok, going to....change over to the google map. however have you ever done directions from google maps ? did you get results like mine? – Sleep Paralysis Jan 14 '15 at 00:43

2 Answers2

1

If you are using MKMapView, you should check out the following examples: http://www.meonbinary.com/2014/02/route-directions-with-ios7-mapkit-and-google-maps-api http://sugartin.info/2011/10/12/drawing-route-on-google-map-mkmapview/

If you are using GMSMapView, check out this stack question: Drawing Route Between Two Places on GMSMapView in iOS

Community
  • 1
  • 1
not_a_bot
  • 2,332
  • 2
  • 19
  • 33
0

I know this is an old thread, but you are not getting 'weird' polylines.. You drawn them manually from the steps. If you look closely on the right map, you see the 'white' dots ? Your polylines follow these dots, you can name them the direction steps.

I have the same issue when I simulate the directions :) That's how I got here. For just drawing, draw routeRequest.routes[0].polyline directly to the map, and it looks good :)

DnS
  • 1