Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript Error - Can't find variable : google
    text
    copied!<p>The code I wrote runs absolutely fine on the browser. But when I connect to wifi on the iPhone I get an error in the debugger : Javascript Error - Can't find variable : google</p> <p>This occurs whenever I call any google maps/directions/geoLocation object. </p> <hr> <p>The code is as follows : </p> <pre><code>map = new Ext.Map({ mapOptions : { center : center, zoom : 20, // mapTypeId : google.maps.MapTypeId.ROADMAP, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.DEFAULT } }, listeners : { maprender : function(comp, map){ pos = new google.maps.LatLng(lats, longs, true); var marker = new google.maps.Marker({ position: pos, //title : 'Sencha HQ', map: map }); map.setMapTypeId(google.maps.MapTypeId.HYBRID); setTimeout( function(){map.panTo (pos);} , 1000); } }, geo:new Ext.util.GeoLocation({ autoUpdate:true, maximumAge: 0, timeout:2000, listeners:{ locationupdate: function(geo) { pos = new google.maps.LatLng(lats, longs, true); center = new google.maps.LatLng(geo.latitude, geo.longitude); if (map.rendered) map.update(center) else map.on('activate', map.onUpdate, map, {single: true, data: pos}); }, locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { if(bLocationUnavailable){ alert('Your Current Location is Unavailable on this device'); } else if (bPermissionDenied){ alert('Location capabilities have been disabled on this device.'); } } } }) }); </code></pre> <p>The error occurs whenever the code encounters the word google. Also for the LatLng object I get the javascript error : "....result of LatLng not a constructor" </p> <p>Note : the variables "lats" and "longs" have been defined n given values before this segment of code</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload