O'Reilly logo

PhoneGap By Example by Andrey Kovalenko

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

Displaying data with Google Maps

Now, it is time to implement the functionality to display pictures we created with our application. It would be nice to display markers on the map for the locations where we created the picture. Let's create a new controller called Places:

$ sencha generate controller Places

This command creates the app/controllers/Places.js file for us. Let's modify it a little bit to look like this:

Ext.define('Travelly.controller.Places', { extend: 'Ext.app.Controller', config: { refs: { mapPlaces: '#mapPlaces' }, control: { mapPlaces: { maprender: 'mapPlacesMapRenderer' } } }, mapPlacesMapRenderer: function(comp, map) { var pictures = this.getPictures(); var map = this.getMapPlaces().getMap(); for (var i = 0; i < pictures.length; ...

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