-
Book Overview & Buying
-
Table Of Contents
Appcelerator Titanium Smartphone App Development Cookbook Second Edition
By :
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.
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 need to add the code that will launch the route directions. According to the Apple Maps URL scheme, it accepts the saddr and daddr parameters to define a start address and an end address. So let's add the...
Change the font size
Change margin width
Change background colour