萤石摄像头
This commit is contained in:
@ -24,11 +24,7 @@ export class LassoSelector {
|
||||
private dragPanInteraction: DragPan | null = null;
|
||||
private mouseWheelZoomInteraction: MouseWheelZoom | null = null;
|
||||
|
||||
constructor(
|
||||
map: OLMap,
|
||||
targetSource: VectorSource,
|
||||
onSelect: (selected: Feature[], isInvert?: boolean) => void
|
||||
) {
|
||||
constructor(map: OLMap, targetSource: VectorSource, onSelect: (selected: Feature[], isInvert?: boolean) => void) {
|
||||
this.map = map;
|
||||
this.targetSource = targetSource;
|
||||
this.onSelectCallback = onSelect;
|
||||
@ -50,9 +46,9 @@ export class LassoSelector {
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#ff0000',
|
||||
width: 2,
|
||||
}),
|
||||
}),
|
||||
width: 2
|
||||
})
|
||||
})
|
||||
});
|
||||
this.map.addLayer(this.drawLayer);
|
||||
|
||||
@ -62,12 +58,12 @@ export class LassoSelector {
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255, 0, 0, 0.8)',
|
||||
width: 2,
|
||||
width: 2
|
||||
}),
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 0, 0, 0.3)',
|
||||
}),
|
||||
}),
|
||||
color: 'rgba(255, 0, 0, 0.3)'
|
||||
})
|
||||
})
|
||||
});
|
||||
this.map.addLayer(this.overlayLayer);
|
||||
|
||||
@ -177,13 +173,10 @@ export class LassoSelector {
|
||||
|
||||
const geomObj = geojson.writeGeometryObject(geom, {
|
||||
featureProjection: 'EPSG:3857',
|
||||
dataProjection: 'EPSG:4326',
|
||||
dataProjection: 'EPSG:4326'
|
||||
}) as any;
|
||||
|
||||
if (
|
||||
(geomObj.type === 'Polygon' || geomObj.type === 'MultiPolygon') &&
|
||||
booleanIntersects(turfPoly, geomObj)
|
||||
) {
|
||||
if ((geomObj.type === 'Polygon' || geomObj.type === 'MultiPolygon') && booleanIntersects(turfPoly, geomObj)) {
|
||||
selected.push(feature);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user