Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props: BaseProps) {
super(props);
const {
map,
showMarker
} = this.props;
const allLayers = MapUtil.getAllLayers(map);
this._positions = new OlGeomLineString([], 'XYZM');
this._geoLocationLayer.setStyle(this._styleFunction);
if (!allLayers.includes(this._geoLocationLayer)) {
map.addLayer(this._geoLocationLayer);
}
this.state = {};
if (showMarker) {
this._markerFeature = new OlFeature();
this._geoLocationLayer.getSource().addFeature(this._markerFeature);
}
}
getVisibleOlUids = () => {
const layers = MapUtil.getAllLayers(this.state.layerGroup, (layer) => {
return !(layer instanceof OlLayerGroup) && layer.getVisible();
}).filter(this.props.filterFunction);
return layers.map(l => l.ol_uid.toString());
}