Sleep Paralysis
Sleep Paralysis

Reputation: 469

Directions not following road on IOS map

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

Upvotes: 1

Views: 928

Answers (2)

DnS
DnS

Reputation: 1

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 :)

Upvotes: 0

not_a_bot
not_a_bot

Reputation: 2362

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

Upvotes: 1

Related Questions