【发布时间】:2017-01-03 15:02:12
【问题描述】:
当我在 OpenLayers 地图中绘制多边形时,我想知道标记是否在多边形内。我在 OpenLayers API 中进行了搜索,但没有找到解决方案。
你可以在link看到我的完整代码。
我的印象是必须修改这个函数:
function addInteraction() {
var value = typeSelect.value;
if (value !== 'None') {
draw = new ol.interaction.Draw({
source: vectorSource,
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
});
map.addInteraction(draw);
draw.on('drawend',function(e){
//Here
});
}
}
我该怎么做?
【问题讨论】: