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

@@ -3,12 +3,14 @@
<script src="../OLLoader.js"></script>
<script type="text/javascript">
function test_ctor_draw(t) {
t.plan(4);
t.plan(5);
var map = new OpenLayers.Map('map');
var vLayer = new OpenLayers.Layer.Vector();
map.addLayer(vLayer);
var editingToolbar = new OpenLayers.Control.EditingToolbar(vLayer);
var editingToolbar = new OpenLayers.Control.EditingToolbar(vLayer, {
citeCompliant: "foo"
});
map.addControl(editingToolbar);
t.ok(editingToolbar instanceof OpenLayers.Control.EditingToolbar,
@@ -19,6 +21,7 @@
"First control is active" );
t.eq(editingToolbar.controls.length, 4,
"EditingToolbar contains 4 Controls" );
t.eq(editingToolbar.controls[1].handler.citeCompliant, "foo", "citeCompliant option passed to handler correctly")
map.destroy();
}