O'Reilly logo

Appcelerator Titanium Smartphone App Development Cookbook - Second Edition by Jason Kneen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Launching Apple Maps and Google Maps with route directions

In previous recipes, we looked at detecting apps, launching them, and passing data to them in the form of a search query in Apple Maps. Now, let's look at passing something more sophisticated, say a route query. In this recipe, we're going to launch some popular mapping applications via a URL.

How to do it...

Let's go back to the app.js file in Studio and add some more code. First, we need to add a new label, so add this under your label2 definition:

var label3 = Ti.UI.createLabel({
    left: 30,
    top: 200,
    text: "Navigate from London to Edinburgh"
});

Next, we need to add the label to the window. So, add the next line of code under the code that adds the first two labels:

win.add(label3);

Now, we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required