update
This commit is contained in:
+13
-10
@@ -41,11 +41,11 @@ export const Map = {
|
||||
* @desc 中国外层边界线
|
||||
*/,
|
||||
drawOutLine() {
|
||||
let geojson = new AMap.GeoJSON({
|
||||
let geoJson = new AMap.GeoJSON({
|
||||
geoJSON: china,
|
||||
getPolygon: function (geojson, lnglats) {
|
||||
getPolygon: function (geoJson, lngLats) {
|
||||
return new AMap.Polyline({
|
||||
path: lnglats[0],
|
||||
path: lngLats[0],
|
||||
strokeColor: '#6ccffe',
|
||||
strokeWeight: 3,
|
||||
lineJoin: 'round', //折线拐点的绘制样式
|
||||
@@ -55,22 +55,22 @@ export const Map = {
|
||||
});
|
||||
},
|
||||
});
|
||||
this.map.add(geojson);
|
||||
this.map.add(geoJson);
|
||||
} /**
|
||||
* @desc 中国内层边界线
|
||||
*/,
|
||||
drawInnerLine() {
|
||||
let geojson = new AMap.GeoJSON({
|
||||
let geoJson = new AMap.GeoJSON({
|
||||
geoJSON: chinaInner,
|
||||
getPolygon: function (geojson, lnglats) {
|
||||
getPolygon: function (geoJson, lngLats) {
|
||||
return new AMap.Polyline({
|
||||
path: lnglats[0],
|
||||
path: lngLats[0],
|
||||
strokeColor: '#359de5',
|
||||
strokeWeight: 1,
|
||||
});
|
||||
},
|
||||
});
|
||||
this.map.add(geojson);
|
||||
this.map.add(geoJson);
|
||||
}, // 清空当前地图上除了边界线的覆盖物
|
||||
removeOverlayGroup() {
|
||||
this.clearAircraft();
|
||||
@@ -92,7 +92,10 @@ export const Map = {
|
||||
this.removeOverlayGroup();
|
||||
this.overlayGroup = new AMap.OverlayGroup();
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
let { type, lon, lat } = result[i];
|
||||
let { type, lon, lat, lng } = result[i];
|
||||
if (lng) {
|
||||
lon = lng;
|
||||
}
|
||||
if (!lon || !lat || !type) {
|
||||
continue;
|
||||
}
|
||||
@@ -231,7 +234,7 @@ export const Map = {
|
||||
label: {
|
||||
content: `<div class="alarm-content" >
|
||||
<div>${option?.realName},${option?.eventType_dictText}</div>
|
||||
</div>`,
|
||||
</div>`,
|
||||
offset: new AMap.Pixel(0, -9),
|
||||
direction: 'top',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user