Changeset 4251
- Timestamp:
- 09/12/07 16:48:28 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Popup.js (modified) (1 diff)
- trunk/openlayers/tests/test_Popup.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Popup.js
r4115 r4251 227 227 if ((this.lonlat) && (this.map)) { 228 228 var px = this.map.getLayerPxFromLonLat(this.lonlat); 229 this.moveTo(px); 229 if (px) { 230 this.moveTo(px); 231 } 230 232 } 231 233 }, trunk/openlayers/tests/test_Popup.html
r4157 r4251 52 52 } 53 53 54 function test_Popup_updatePosition(t) { 55 t.plan(1) 56 var map = new OpenLayers.Map('map'); 57 map.addLayer(new OpenLayers.Layer('name', {'isBaseLayer':true})); 58 map.zoomToMaxExtent(); 59 var popup = new OpenLayers.Popup('id'); 60 map.addPopup(popup); 61 map.getLayerPxFromLonLat = function () { return null; } 62 popup.moveTo=function() { t.fail("Shouldnt' call moveTo if layerpx is null"); } 63 popup.lonlat = true; 64 popup.updatePosition(); 65 t.ok(true, "update position doesn't fail when getLayerPxFromLonLat fails."); 66 } 54 67 function test_03_Popup_draw(t) { 55 68 t.plan( 17 ); … … 110 123 </head> 111 124 <body> 125 <div id="map" style="width:512px; height:256px"> </div> 112 126 </body> 113 127 </html>
