[OpenLayers-Trac] [OpenLayers] #3639: setCenter not working with google map

OpenLayers trac-20090302 at openlayers.org
Thu Mar 22 01:02:13 EDT 2012


#3639: setCenter not working with google map
----------------------+-----------------------------------------------------
 Reporter:  djasinsk  |       Owner:      
     Type:  feature   |      Status:  new 
 Priority:  critical  |   Milestone:      
Component:  general   |     Version:  2.11
 Keywords:            |       State:      
----------------------+-----------------------------------------------------
 Trying to set the default view of a google map and it keeps centering on
 0,0.
 My code:
 var map;
  function init() {
  map = new OpenLayers.Map('map_element', {});
  var gml = new OpenLayers.Layer.Google(
         'Google Map Layer',
         {type: google.maps.MapTypeId.TERRAIN}
         );
         map.addLayer(gml);
         map.setCenter( new OpenLayers.LonLat( -77.4548222,37.5416611), 5);
         map.addControl( new OpenLayers.Control.LayerSwitcher({}));

         }

 Also, anytime I try to interact with the map (zoom, pan) , I get a pop-up
 box showing the Map Data source. Can this be disabled??

 Help - I'm an Openlayers newbie!

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3639>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list