[OpenLayers-Trac] Re: [OpenLayers] #3571: moveTo generates "Uncaught TypeError: Cannot call method 'getLonLatFromLayerPx' of null"

OpenLayers trac-20090302 at openlayers.org
Tue Nov 8 11:00:43 EST 2011


#3571: moveTo generates "Uncaught TypeError: Cannot call method
'getLonLatFromLayerPx' of null"
-----------------------------+----------------------------------------------
  Reporter:  outbreakmonkey  |       Owner:  euzuro                                 
      Type:  bug             |      Status:  closed                                 
  Priority:  minor           |   Milestone:  2.12 Release                           
 Component:  Marker          |     Version:  2.11                                   
Resolution:  invalid         |    Keywords:  moveto, typeerror, getLonLatFromLayerPx
     State:                  |  
-----------------------------+----------------------------------------------
Changes (by ahocevar):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 Add the marker to the map after setting the map center, i.e.
 {{{
 map.setCenter(lonLat,16); // Center of the map
 markers.addMarker(currentposmarker);
 }}}

 Since both Marker and Layer.Markers are deprecated, you may also want to
 consider using Vector layers instead.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3571#comment:1>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list