openlayers实现绘制矩形查询
目录
openlayers实现绘制矩形查询
功能说明
openlayers实现绘制矩形
代码如下
var layer=new ol.layer.Vector({
source:new ol.source.Vector()
})
var draw = new ol.interaction.Draw({
source: layer.getSource(),
type: 'Circle',
geometryFunction: ol.interaction.Draw.createBox()
});
map.addInteraction(draw);
draw.on('drawend',function(e){
var geom=e.feature.getGeometry();
})
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.