I'm attempting to use the Box Handler to allow the user to draw a bounding box
on the map. (code below)
the problem im having is that the feature that ends up being created is suppose
to be a polygon with the same bounds produced by the box,
but what i end up with is an extreamly tiny polygon at 0,0.
I'm using a google base so i thought maybe the projection was the culprit, but
i've tried transforming the bounds and nothing good seems to come from it.
any ideas?
var control = new OpenLayers.Control({
draw: function () {
this.box = new OpenLayers.Handler.Box( control,
{done: this.notice},
{keyMask: OpenLayers.Handler.MOD_SHIFT});
this.box.activate();
},
notice: function (bounds){
var geom = bounds.toGeometry();
var feature = new OpenLayers.Feature.Vector(geom);
_bboxLayer.addFeatures(feature);
_map.zoomToExtent(bounds,true);
}
});
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users