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

Customizing annotations and adding events to your MapView

Annotations can also be customized to give the user a better indication of what your location symbolizes. For example, if you are mapping the restaurants in a particular area, you may provide each annotation with an icon that symbolizes the type of restaurant it is—it can be a pizza slice for Italian food, a pint for pub food, or a hamburger for a fast food chain.

In this recipe, we will add a start button to the first pin and a stop button to the second, which we will use to control our exercise timer later on.

How to do it...

After your annotation is declared but before it is added to your mapView object, type in the following code to create a custom leftButton and a custom rightButton

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