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:
@@ -24,6 +24,13 @@
|
||||
OpenLayers.Control.EditingToolbar = OpenLayers.Class(
|
||||
OpenLayers.Control.Panel, {
|
||||
|
||||
/**
|
||||
* APIProperty: citeCompliant
|
||||
* {Boolean} If set to true, coordinates of features drawn in a map extent
|
||||
* crossing the date line won't exceed the world bounds. Default is false.
|
||||
*/
|
||||
citeCompliant: false,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.EditingToolbar
|
||||
* Create an editing toolbar for a given layer.
|
||||
@@ -39,9 +46,18 @@ OpenLayers.Control.EditingToolbar = OpenLayers.Class(
|
||||
[ new OpenLayers.Control.Navigation() ]
|
||||
);
|
||||
var controls = [
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Point, {'displayClass': 'olControlDrawFeaturePoint'}),
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Path, {'displayClass': 'olControlDrawFeaturePath'}),
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Polygon, {'displayClass': 'olControlDrawFeaturePolygon'})
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Point, {
|
||||
displayClass: 'olControlDrawFeaturePoint',
|
||||
handlerOptions: {citeCompliant: this.citeCompliant}
|
||||
}),
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Path, {
|
||||
displayClass: 'olControlDrawFeaturePath',
|
||||
handlerOptions: {citeCompliant: this.citeCompliant}
|
||||
}),
|
||||
new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Polygon, {
|
||||
displayClass: 'olControlDrawFeaturePolygon',
|
||||
handlerOptions: {citeCompliant: this.citeCompliant}
|
||||
})
|
||||
];
|
||||
this.addControls(controls);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user