feat
This commit is contained in:
parent
4be3c6bc11
commit
67f0284918
@ -33,7 +33,7 @@ initAMapApiLoader({
|
|||||||
AMapUI: {
|
AMapUI: {
|
||||||
plugins: ['misc/PathSimplifier'],
|
plugins: ['misc/PathSimplifier'],
|
||||||
},
|
},
|
||||||
plugins: ['AMap.MapType'],
|
plugins: ['AMap.MapType', 'AMap.DistrictSearch'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="plant-gs-warp">
|
<div class="plant-gs-warp">
|
||||||
<div ref="viewwarp" class="plant-gs-content" :style="{ 'background-image': 'url(' + getAssetsFile('images/plant/bg1.png') + ')' }">
|
<div ref="viewwarp" class="plant-gs-content" :style="{ 'background-image': 'url(' + getAssetsFile('images/plant/bg1.png') + ')' }">
|
||||||
<el-amap :zoom="11" :center="[99.402267, 23.538889]" ref="mapRef">
|
<el-amap ref="mapRef" :zoom="11" :center="[99.402267, 23.538889]" :mask="yunnan" view-mode="3D" @init="initMap">
|
||||||
<!-- 带孔洞的四边形 -->
|
<!-- 带孔洞的四边形 -->
|
||||||
<el-amap-layer-satellite :visible="visible" />
|
<el-amap-layer-satellite :visible="visible" />
|
||||||
<el-amap-polygon :path="polygon" :fill-opacity="0.5" fill-color="#748cb7" stroke-color="transparent" />
|
<el-amap-polygon :path="polygon" :fill-opacity="0.5" fill-color="#748cb7" stroke-color="transparent" />
|
||||||
@ -13,6 +13,7 @@
|
|||||||
import { isEmpty, getAssetsFile } from '@/utils';
|
import { isEmpty, getAssetsFile } from '@/utils';
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { ElAmap, ElAmapPolygon } from '@vuemap/vue-amap';
|
import { ElAmap, ElAmapPolygon } from '@vuemap/vue-amap';
|
||||||
|
import { ElAmapLoca, ElAmapLocaHeatmap } from '@vuemap/vue-amap-loca';
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
|
|
||||||
const zoom = ref(15);
|
const zoom = ref(15);
|
||||||
@ -33,7 +34,23 @@ const polygon = reactive([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const mapRef = ref(null);
|
const mapRef = ref(null);
|
||||||
onMounted(() => {});
|
const yunnan = ref([]);
|
||||||
|
function initMap(e) {
|
||||||
|
var opts = {
|
||||||
|
subdistrict: 0,
|
||||||
|
extensions: 'all',
|
||||||
|
level: 'province',
|
||||||
|
};
|
||||||
|
var district = new AMap.DistrictSearch(opts);
|
||||||
|
district.search('云南省', function (status, result) {
|
||||||
|
console.log('res', result);
|
||||||
|
var bounds = result.districtList[0].boundaries;
|
||||||
|
for (var i = 0; i < bounds.length; i += 1) {
|
||||||
|
yunnan.value.push([bounds[i]]);
|
||||||
|
}
|
||||||
|
console.log('mask.value', yunnan.value);
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.plant-gs-warp {
|
.plant-gs-warp {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user