Sunday 16 September 2018

openlayers 2 - OpenLayers2 - zoom to selected feature


If I have this vector layer:


var vectors = new OpenLayers.Layer.Vector("vector", {isBaseLayer: false});
var feature = new OpenLayers.Feature.Vector(
OpenLayers.Geometry.fromWKT(
"POLYGON ((-18 -3, -18 14, 15 14, 15 -3, -18 -3))"
)
);
vectors.addFeatures([feature]);


How I can zoom to a selected feature of the layer by a single click event?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...