diff --git a/package.json b/package.json index cf2c808..2c8a379 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/patches/avue-plugin-map+1.0.1.patch b/patches/avue-plugin-map+1.0.1.patch new file mode 100644 index 0000000..41f6bfa --- /dev/null +++ b/patches/avue-plugin-map+1.0.1.patch @@ -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({