Prevent popups from failing when getLayerPxFromLonLat returns null (which is possible

in the case of a not-yet-setup layer, for example).


git-svn-id: http://svn.openlayers.org/trunk/openlayers@4251 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-09-12 20:48:28 +00:00
parent ebc60202b7
commit aa70587033
2 changed files with 17 additions and 1 deletions

View File

@@ -226,7 +226,9 @@ OpenLayers.Popup = OpenLayers.Class({
updatePosition: function() {
if ((this.lonlat) && (this.map)) {
var px = this.map.getLayerPxFromLonLat(this.lonlat);
this.moveTo(px);
if (px) {
this.moveTo(px);
}
}
},