Changeset 5433
- Timestamp:
- 12/15/07 16:29:06 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Handler/Path.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Handler/Point.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Handler/Polygon.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/EventPane.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Handler/Path.js
r4985 r5433 80 80 destroyFeature: function() { 81 81 OpenLayers.Handler.Point.prototype.destroyFeature.apply(this); 82 this.line.destroy(); 82 if(this.line) { 83 this.line.destroy(); 84 } 83 85 this.line = null; 84 86 }, trunk/openlayers/lib/OpenLayers/Handler/Point.js
r5396 r5433 139 139 */ 140 140 destroyFeature: function() { 141 this.point.destroy(); 141 if(this.point) { 142 this.point.destroy(); 143 } 142 144 this.point = null; 143 145 }, trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
r4985 r5433 66 66 destroyFeature: function() { 67 67 OpenLayers.Handler.Path.prototype.destroyFeature.apply(this); 68 this.polygon.destroy(); 68 if(this.polygon) { 69 this.polygon.destroy(); 70 } 69 71 this.polygon = null; 70 72 }, trunk/openlayers/lib/OpenLayers/Layer/EventPane.js
r5232 r5433 238 238 !(newZoom == oldZoom) ) { 239 239 240 var center = this.getMapObjectLonLatFromOLLonLat(newCenter);241 242 240 if (dragging && this.dragPanMapObject && 243 241 this.smoothDragPan) { … … 247 245 this.dragPanMapObject(dX, dY); 248 246 } else { 247 var center = this.getMapObjectLonLatFromOLLonLat(newCenter); 249 248 var zoom = this.getMapObjectZoomFromOLZoom(newZoom); 250 249 this.setMapObjectCenter(center, zoom, dragging); … … 281 280 var moLonLat = this.getMapObjectLonLatFromMapObjectPixel(moPixel); 282 281 lonlat = this.getOLLonLatFromMapObjectLonLat(moLonLat); 282 var xrem = this.map.size.w % 2; 283 var yrem = this.map.size.h % 2; 284 if(xrem != 0 || yrem != 0) { 285 // odd sized viewport 286 var olPx = viewPortPx.add(xrem, yrem); 287 var moPx = this.getMapObjectPixelFromOLPixel(olPx); 288 var moLoc = this.getMapObjectLonLatFromMapObjectPixel(moPx); 289 var olLoc = this.getOLLonLatFromMapObjectLonLat(moLoc); 290 // adjust by half a pixel in odd dimension(s) 291 lonlat.lon += (olLoc.lon - lonlat.lon) / 2; 292 lonlat.lat += (olLoc.lat - lonlat.lat) / 2; 293 } 283 294 } 284 295 return lonlat;
