Making sketch handlers work over the dateline by using layer.getLonLatFromViewPortPx instead of map.getLonLatFromPixel. Thanks bartvde for the unit and acceptance tests. r=bartvde (closes #2787)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12346 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-09-08 17:53:44 +00:00
parent 21423cefe2
commit 98be6e313b
10 changed files with 175 additions and 23 deletions

View File

@@ -75,7 +75,7 @@ OpenLayers.Handler.Polygon = OpenLayers.Class(OpenLayers.Handler.Path, {
* feature.
*/
createFeature: function(pixel) {
var lonlat = this.map.getLonLatFromPixel(pixel);
var lonlat = this.layer.getLonLatFromViewPortPx(pixel);
var geometry = new OpenLayers.Geometry.Point(
lonlat.lon, lonlat.lat
);