bluedevil2k
bluedevil2k

Reputation: 9491

Titanium Appcelerator - Creating Directions Using a Map?

I'm creating a simple Map application in Titanium Appcelerator, right now focusing only on iOS. I have 2 Annotations specified by the latitude and longitude. I want to draw the directions between the 2 points on the Map.

I see the

mapview.addRoute();

method on the MapView object, but it requires you to input all the points in the route to draw it properly?! That doesn't sound right at all - why would it require me to find all the points when the Google Map can do that already.

Is there a way that I'm missing to simply say "here's point A, here's point B, draw the route between the 2 points on the map".

Upvotes: 1

Views: 4276

Answers (1)

Dan Tamas
Dan Tamas

Reputation: 81

Drawing routes on the map is nothing more than a vector drawing. The same does the mapsapp on your phone.

You will have to interrogate the maps apis for directions,get the directions (points) and use it in your code to draw the route.

If you don't want to do it yourself there is a free module in the marketplace that can help

https://marketplace.appcelerator.com/apps/2580?87150712

If you want to get your hands dirty, this post might help you:

http://developer.appcelerator.com/question/74221/mobile-map-route-from-google-server

Upvotes: 3

Related Questions