|
@@ -93,6 +93,8 @@ interface State {
|
|
markers: MarkerType[];
|
|
markers: MarkerType[];
|
|
positions: string[];
|
|
positions: string[];
|
|
hasTypes: string[];
|
|
hasTypes: string[];
|
|
|
|
+ markCircle: any;
|
|
|
|
+ markCirclelayer:any;
|
|
// theSocket: null;
|
|
// theSocket: null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -154,9 +156,13 @@ export default defineComponent({
|
|
markers: [],
|
|
markers: [],
|
|
positions: [],
|
|
positions: [],
|
|
hasTypes: [],
|
|
hasTypes: [],
|
|
|
|
+ markCircle: {},
|
|
|
|
+ markCirclelayer: {},
|
|
// theSocket:null
|
|
// theSocket:null
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
const store = useMarkerStore();
|
|
const store = useMarkerStore();
|
|
const mainstore = useMainStore();
|
|
const mainstore = useMainStore();
|
|
const incidentStore = useIncidentStore();
|
|
const incidentStore = useIncidentStore();
|
|
@@ -701,6 +707,45 @@ export default defineComponent({
|
|
)
|
|
)
|
|
: image;
|
|
: image;
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
+ // state.map.removeSource('pointSource');
|
|
|
|
+ // state.map.removeLayer('polygonLayer');
|
|
|
|
+ if (type === '应急事件') {
|
|
|
|
+ state.markCircle = {
|
|
|
|
+ type: 'geojson',
|
|
|
|
+ data: turf.circle(
|
|
|
|
+ [
|
|
|
|
+ parseFloat(i.locations?.split(',')[0] ?? '0'),
|
|
|
|
+ parseFloat(i.locations?.split(',')[1] ?? '0'),
|
|
|
|
+ ],
|
|
|
|
+ 5,
|
|
|
|
+ {
|
|
|
|
+ steps: 164,
|
|
|
|
+ units: 'kilometers',
|
|
|
|
+ properties: { foo: 'bar' },
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ };
|
|
|
|
+ // mySource = state.markCircle;
|
|
|
|
+ state.map.addSource('pointSource', state.markCircle);
|
|
|
|
+
|
|
|
|
+ state.markCirclelayer = {
|
|
|
|
+ id: 'polygonLayer',
|
|
|
|
+ type: 'fill',
|
|
|
|
+ source: 'pointSource',
|
|
|
|
+ layout: {},
|
|
|
|
+ paint: {
|
|
|
|
+ 'fill-color': '#0dacfc',
|
|
|
|
+ 'fill-opacity': 0.2,
|
|
|
|
+ 'fill-translate': [-10, -10],
|
|
|
|
+ 'fill-outline-color': '#0a217d',
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ state.map.addLayer(state.markCirclelayer);
|
|
|
|
+ }
|
|
|
|
+ } catch (E) {}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
if (type == "视频监控") {
|
|
if (type == "视频监控") {
|
|
if (i.isOnline == false) {
|
|
if (i.isOnline == false) {
|
|
@@ -780,7 +825,7 @@ export default defineComponent({
|
|
imagep.innerHTML = "";
|
|
imagep.innerHTML = "";
|
|
markp.setZIndex(0);
|
|
markp.setZIndex(0);
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
return {
|
|
return {
|
|
locations: i.locations,
|
|
locations: i.locations,
|
|
@@ -844,8 +889,8 @@ export default defineComponent({
|
|
type: MarkerMapType,
|
|
type: MarkerMapType,
|
|
markers: State['markers'],
|
|
markers: State['markers'],
|
|
) => {
|
|
) => {
|
|
|
|
+
|
|
state.hasTypes = state.hasTypes.filter((t) => t !== type);
|
|
state.hasTypes = state.hasTypes.filter((t) => t !== type);
|
|
-
|
|
|
|
const locations = markers.map((i) => i.locations);
|
|
const locations = markers.map((i) => i.locations);
|
|
state.markers.forEach((m) => {
|
|
state.markers.forEach((m) => {
|
|
if (locations.includes(m.locations)) {
|
|
if (locations.includes(m.locations)) {
|
|
@@ -863,6 +908,12 @@ export default defineComponent({
|
|
handleFitBounds();
|
|
handleFitBounds();
|
|
};
|
|
};
|
|
const handleRemoveAllMarkers = () => {
|
|
const handleRemoveAllMarkers = () => {
|
|
|
|
+ try {
|
|
|
|
+ state.map.removeSource('pointSource');
|
|
|
|
+ state.map.removeLayer('polygonLayer');
|
|
|
|
+
|
|
|
|
+ } catch (E) { }
|
|
|
|
+
|
|
state.markers.forEach((m) => {
|
|
state.markers.forEach((m) => {
|
|
m.marker?.remove();
|
|
m.marker?.remove();
|
|
m.popup?.remove();
|
|
m.popup?.remove();
|
|
@@ -1030,6 +1081,7 @@ export default defineComponent({
|
|
} else {
|
|
} else {
|
|
handleRemoveAllMarkers();
|
|
handleRemoveAllMarkers();
|
|
if (state.types.includes('应急事件')) {
|
|
if (state.types.includes('应急事件')) {
|
|
|
|
+
|
|
state.types.forEach((next) => {
|
|
state.types.forEach((next) => {
|
|
actionTypes.value.forEach((item) => {
|
|
actionTypes.value.forEach((item) => {
|
|
if (next === item.type) {
|
|
if (next === item.type) {
|