|
@@ -713,18 +713,20 @@ export default defineComponent({
|
|
if (type === '应急事件') {
|
|
if (type === '应急事件') {
|
|
state.markCircle = {
|
|
state.markCircle = {
|
|
type: 'geojson',
|
|
type: 'geojson',
|
|
- data: turf.circle(
|
|
|
|
|
|
+ data:turf.circle(
|
|
[
|
|
[
|
|
parseFloat(i.locations?.split(',')[0] ?? '0'),
|
|
parseFloat(i.locations?.split(',')[0] ?? '0'),
|
|
parseFloat(i.locations?.split(',')[1] ?? '0'),
|
|
parseFloat(i.locations?.split(',')[1] ?? '0'),
|
|
],
|
|
],
|
|
5,
|
|
5,
|
|
{
|
|
{
|
|
- steps: 164,
|
|
|
|
|
|
+ steps: 499,
|
|
units: 'kilometers',
|
|
units: 'kilometers',
|
|
properties: { foo: 'bar' },
|
|
properties: { foo: 'bar' },
|
|
},
|
|
},
|
|
),
|
|
),
|
|
|
|
+
|
|
|
|
+
|
|
};
|
|
};
|
|
// mySource = state.markCircle;
|
|
// mySource = state.markCircle;
|
|
state.map.addSource('pointSource', state.markCircle);
|
|
state.map.addSource('pointSource', state.markCircle);
|
|
@@ -737,7 +739,7 @@ export default defineComponent({
|
|
],
|
|
],
|
|
10,
|
|
10,
|
|
{
|
|
{
|
|
- steps: 164,
|
|
|
|
|
|
+ steps: 64,
|
|
units: 'kilometers',
|
|
units: 'kilometers',
|
|
properties: { foo: 'bar' },
|
|
properties: { foo: 'bar' },
|
|
},
|
|
},
|
|
@@ -748,27 +750,91 @@ export default defineComponent({
|
|
id: 'polygonLayer',
|
|
id: 'polygonLayer',
|
|
type: 'fill',
|
|
type: 'fill',
|
|
source: 'pointSource',
|
|
source: 'pointSource',
|
|
- layout: {},
|
|
|
|
|
|
+ layout: {
|
|
|
|
+ visibility: 'visible',
|
|
|
|
+ },
|
|
paint: {
|
|
paint: {
|
|
- 'fill-color': '#0dacfc',
|
|
|
|
- 'fill-opacity': 0.1,
|
|
|
|
- 'fill-translate': [-10, -10],
|
|
|
|
- 'fill-outline-color': '#0a217d',
|
|
|
|
|
|
+ 'fill-antialias': true, //2d的半径是实际尺寸,单位是米,不是像素值
|
|
|
|
+ 'fill-color': '#143981',
|
|
|
|
+ 'fill-opacity': 0.5,
|
|
|
|
+ 'fill-outline-color': 'red',
|
|
|
|
+ // 'fill-outline-width':20
|
|
},
|
|
},
|
|
|
|
+ minzoom: 7, //2d不支持
|
|
|
|
+ maxzoom: 17.5, //2d不支持
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+
|
|
state.map.addLayer(state.markCirclelayer);
|
|
state.map.addLayer(state.markCirclelayer);
|
|
- state.map.addLayer({
|
|
|
|
- id: 'polygonLayer1',
|
|
|
|
- type: 'fill',
|
|
|
|
- source: 'pointSource1',
|
|
|
|
- layout: {},
|
|
|
|
- paint: {
|
|
|
|
- 'fill-color': '#0dacfc',
|
|
|
|
- 'fill-opacity': 0.2,
|
|
|
|
- 'fill-translate': [-10, -10],
|
|
|
|
- 'fill-outline-color': '#0a217d',
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ state.map.addLayer({
|
|
|
|
+ id: 'polygonLayer2',
|
|
|
|
+ type: 'line',
|
|
|
|
+ source: 'pointSource',
|
|
|
|
+ layout: {},
|
|
|
|
+ paint: {
|
|
|
|
+ // 'fill-color': '#0dacfc',
|
|
|
|
+ // 'fill-opacity': 0.2,
|
|
|
|
+ // 'fill-translate': [-10, -10],
|
|
|
|
+ 'line-color': '#143981',
|
|
|
|
+ 'line-width': 5,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ state.map.addLayer({
|
|
|
|
+ id: 'polygonLayer3',
|
|
|
|
+ type: 'fill',
|
|
|
|
+ source: 'pointSource1',
|
|
|
|
+ layout: {
|
|
|
|
+ visibility: 'visible',
|
|
|
|
+ },
|
|
|
|
+ paint: {
|
|
|
|
+ 'fill-antialias': true,
|
|
|
|
+ 'fill-color': '#143981',
|
|
|
|
+ 'fill-opacity': 0.3,
|
|
|
|
+ },
|
|
|
|
+ minzoom: 7, //2d不支持
|
|
|
|
+ maxzoom: 17.5, //2d不支持
|
|
|
|
+ });
|
|
|
|
+ state.map.addLayer({
|
|
|
|
+ id: 'polygonLayer1',
|
|
|
|
+ type: 'line',
|
|
|
|
+ source: 'pointSource1',
|
|
|
|
+ layout: {},
|
|
|
|
+ paint: {
|
|
|
|
+ // 'fill-color': '#0dacfc',
|
|
|
|
+ // 'fill-opacity': 0.2,
|
|
|
|
+ // 'fill-translate': [-10, -10],
|
|
|
|
+ 'line-color': '#143981',
|
|
|
|
+ 'line-width': 5,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // state.map.addLayer({
|
|
|
|
+ // id: 'polygonLayer4',
|
|
|
|
+ // type: 'symbol',
|
|
|
|
+ // source: 'pointSource1',
|
|
|
|
+ // layout: {
|
|
|
|
+ // 'text-field': '10km',
|
|
|
|
+ // 'text-size': 40,
|
|
|
|
+ // },
|
|
|
|
+ // paint: {
|
|
|
|
+ // 'text-color': 'red',
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // });
|
|
|
|
+ // state.map.addLayer({
|
|
|
|
+ // id: 'polygonLayer5',
|
|
|
|
+ // type: 'symbol',
|
|
|
|
+ // source: 'pointSource',
|
|
|
|
+ // layout: {
|
|
|
|
+ // 'text-field': '5km',
|
|
|
|
+ // 'text-size': 40,
|
|
|
|
+ // },
|
|
|
|
+ // paint: {
|
|
|
|
+ // 'text-color': 'red',
|
|
|
|
+ // },
|
|
|
|
+ // });
|
|
|
|
+
|
|
}
|
|
}
|
|
} catch (E) {}
|
|
} catch (E) {}
|
|
|
|
|
|
@@ -831,7 +897,11 @@ export default defineComponent({
|
|
// }
|
|
// }
|
|
// debugger
|
|
// debugger
|
|
|
|
|
|
- var imagep= renderElement(nextImage);
|
|
|
|
|
|
+ var imagep = renderElement(nextImage);
|
|
|
|
+ if (type === '应急事件') {
|
|
|
|
+ imagep.style.width = (24 * 3 * 2) / 576 + 'rem';
|
|
|
|
+ imagep.style.height = (25 * 3 * 2) / 576 + 'rem';
|
|
|
|
+ }
|
|
var markp =
|
|
var markp =
|
|
new window.minemap.Marker(imagep, {
|
|
new window.minemap.Marker(imagep, {
|
|
offset: [-25, -25],
|
|
offset: [-25, -25],
|
|
@@ -936,11 +1006,14 @@ export default defineComponent({
|
|
};
|
|
};
|
|
const handleRemoveAllMarkers = () => {
|
|
const handleRemoveAllMarkers = () => {
|
|
try {
|
|
try {
|
|
- state.map.removeSource('pointSource');
|
|
|
|
- state.map.removeLayer('polygonLayer');
|
|
|
|
|
|
+ state.map.removeSource('pointSource');
|
|
state.map.removeSource('pointSource1');
|
|
state.map.removeSource('pointSource1');
|
|
- state.map.removeLayer('polygonLayer1');
|
|
|
|
|
|
+ state.map.removeLayer('polygonLayer');
|
|
|
|
+ state.map.removeLayer('polygonLayer1');
|
|
|
|
+ state.map.removeLayer('polygonLayer2');
|
|
|
|
+ state.map.removeLayer('polygonLayer3');
|
|
|
|
|
|
|
|
+
|
|
} catch (E) { }
|
|
} catch (E) { }
|
|
|
|
|
|
state.markers.forEach((m) => {
|
|
state.markers.forEach((m) => {
|