In the 3.X version, for a circle, the draw polygon is not better to filter the included points, and 4. In the X version, only the call to geom.intersectscoordinate([Lng,lat] has been implemented perfectly. The complete code is as follows:
Drawselect:function () {
Draw.clear ();
Draw.griddrawlayer = new Ol.layer.Vector ({
Source:draw.griddrawSource,
Style:draw.griddrawstyle,
zindex:900
});
Map.addlayer (Draw.griddrawlayer);
Draw = new Ol.interaction.Draw ({
Source:draw.griddrawSource,
Type: ' Circle '
});
Map.addinteraction (Draw);
Draw.on ("Drawstart", function (evt) {
Sketch= evt.feature;
}, this);
Draw.on ("Drawend", function (evt) {
Map.removeinteraction (Draw);
var geom= evt.feature.getGeometry ();
Vectorsource.foreachfeature (function (_feature) {
var layername = _feature.get ("LayerName");
if (LayerName = = "Videolayer") {
var LNG = _feature.get ("LNG");
var lat = _feature.get ("lat");
if (geom.intersectscoordinate ([lng,lat]) = = True) {
var name = _feature.get ("name");
var code = _feature.get ("code");
List.push ({"Code": Code, "name": name});
}
}
});
}, this);
},
Openlayers3. X with 4. X circle and Draw polygon API differences