[OpenLayers-Trac] [OpenLayers] #3484: setcenter is not being nice....

OpenLayers trac-20090302 at openlayers.org
Wed Aug 31 21:27:47 EDT 2011

#3484: setcenter is not being nice....
 Reporter:  cpugenuis  |       Owner:              
     Type:  bug        |      Status:  new         
 Priority:  trivial    |   Milestone:  2.10 Release
Component:  Map        |     Version:  2.11 RC3    
 Keywords:             |       State:              
 so, i am running openlayers, and it isn't properly setting the
 coordinates. i followed the PDF guide by packt publishing, and it isn't
 working. i got it to show me where the center is, but when i put in the
 coordinates, it goes to those coordinates, but it nullifies the zoom. what
 is going on? i had problems earlier with a similar (but much outdated)

 here is the code

 <title>OpenLayers Example</title>
 <meta charset='utf-8' />
         <script src='http://openlayers.org/api/OpenLayers.js'></script>
                 <div style="width:100%; height:100%" id="map"></div>
                 <script type="text/javascript">
                 var map = new OpenLayers.Map('map');

                         var gmap = new
 OpenLayers.Layer.Google("GMaps",{type: G_HYBRID_MAP, numZoomLevels: 20});


                         map.setCenter(new OpenLayers.LonLat(0,0), 15);

                         map.setCenter(new OpenLayers.LonLat(39, 89), 5);


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

More information about the Trac mailing list