avue-plugin-map补丁修改

master
xy 1 year ago
parent 697f7fff29
commit f644cc58c1

@ -7,6 +7,7 @@
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"postinstall": "patch-package",
"preview": "node build/index.js --preview",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"lint": "eslint --ext .js,.vue src",

@ -0,0 +1,33 @@
diff --git a/node_modules/avue-plugin-map/packages/map/src/main.vue b/node_modules/avue-plugin-map/packages/map/src/main.vue
index 877fc0a..4d8e385 100644
--- a/node_modules/avue-plugin-map/packages/map/src/main.vue
+++ b/node_modules/avue-plugin-map/packages/map/src/main.vue
@@ -174,8 +174,11 @@ export default {
});
},
init (callback) {
+ const satellite = new AMap.TileLayer.Satellite();
+ const roadNet = new AMap.TileLayer.RoadNet();
this.map = new window.AMap.Map("map__container", {
zoom: 13,
+ layers: [satellite, roadNet],
center: (() => {
if (this.longitude && this.latitude) {
return [this.longitude, this.latitude];
@@ -183,9 +186,16 @@ export default {
})()
});
this.initPoip();
+ this.initToolbar();
this.addClick();
callback();
},
+ initToolbar () {
+ this.map.plugin(["AMap.ToolBar"],() => {
+ //加载工具条
+ this.map.addControl(new AMap.ToolBar());
+ });
+ },
initPoip () {
window.AMapUI.loadUI(["misc/PoiPicker"], PoiPicker => {
var poiPicker = new PoiPicker({
Loading…
Cancel
Save