MousePosition control throws error when no layers are on map. Fix it so that
they don't. Thanks for the review, fredj. Includes tests. (Closes #1029) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5371 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -108,6 +108,10 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
|
||||
lonLat = this.map.getLonLatFromPixel(evt.xy);
|
||||
if (!lonLat) {
|
||||
// map has not yet been properly initialized
|
||||
return;
|
||||
}
|
||||
this.lastXy = evt.xy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user