vendredi 16 mai 2014

Google maps issue - on 'build testing' error "google is not defined"

I have an app working on localhost using google maps to show a map, drop markers and add data through infowindows.

But when I build it as testing or production I get the error "google is not defined"

I've looked at many examples and read lots of threads re where to put the reference to google's api, and have therefore moved it to app.json:



Code:



"js": [
........
{
"path": "http://ift.tt/UE5hJi",
"remote": true
}
],

The error message points to the mapOptions reference that creates a centre-point for the map (and as expected, if I comment that line out, it just errors on the following reference to google):

Code:



Ext.define('roadfaults.view.MapPanel', {
extend: Ext.Map ,
xtype: 'mappanel',
id: 'stumap',
name: 'faultmap',
title: 'Map',
config: {
useCurrentLocation: true,
mapOptions: {
//center: new google.maps.LatLng(this.geo.getLatitude(), this.geo.getLongitude()),
//center: new google.maps.LatLng (-36.9149749,174.4915772),
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 14
},

Any clues as to why the error?

thanks

...stu





Aucun commentaire:

Enregistrer un commentaire