Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 2nd, 2012  |  syntax: None  |  size: 1.70 KB  |  hits: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Javascript Error - Can't find variable : google
  2. map = new Ext.Map({
  3.     mapOptions : {
  4.         center : center,
  5.         zoom : 20,
  6.        // mapTypeId : google.maps.MapTypeId.ROADMAP,
  7.         navigationControl: true,
  8.         navigationControlOptions: {
  9.                 style: google.maps.NavigationControlStyle.DEFAULT
  10.             }
  11.     },
  12.  
  13.     listeners : {
  14.         maprender : function(comp, map){
  15.             pos = new google.maps.LatLng(lats, longs, true);
  16.             var marker = new google.maps.Marker({
  17.                  position: pos,
  18.                  //title : 'Sencha HQ',
  19.                  map: map
  20.             });
  21.  
  22.             map.setMapTypeId(google.maps.MapTypeId.HYBRID);
  23.             setTimeout( function(){map.panTo (pos);} , 1000);
  24.         }
  25.     },
  26.  
  27.      geo:new Ext.util.GeoLocation({
  28.          autoUpdate:true,
  29.          maximumAge: 0,
  30.          timeout:2000,
  31.          listeners:{
  32.              locationupdate: function(geo) {
  33.                  pos = new google.maps.LatLng(lats, longs, true);
  34.                  center = new google.maps.LatLng(geo.latitude, geo.longitude);
  35.                  if (map.rendered)
  36.                      map.update(center)
  37.                  else
  38.                      map.on('activate', map.onUpdate, map, {single: true, data: pos});
  39.              },
  40.              locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
  41.                  if(bLocationUnavailable){
  42.                      alert('Your Current Location is Unavailable on this device');
  43.                  }
  44.                  else if (bPermissionDenied){
  45.                      alert('Location capabilities have been disabled on this device.');
  46.                  }      
  47.              }
  48.          }
  49.      })
  50. });