Commit 8a2155be authored by 郭铭瑶's avatar 郭铭瑶 🤘

增加地图缩放、拖动操作及地图字体调整

parent c97e23b3
src/assets/images/flow-point.png

7.68 KB | W: | H:

src/assets/images/flow-point.png

7.09 KB | W: | H:

src/assets/images/flow-point.png
src/assets/images/flow-point.png
src/assets/images/flow-point.png
src/assets/images/flow-point.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/images/home-card-bg.png

10.8 KB | W: | H:

src/assets/images/home-card-bg.png

10.6 KB | W: | H:

src/assets/images/home-card-bg.png
src/assets/images/home-card-bg.png
src/assets/images/home-card-bg.png
src/assets/images/home-card-bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/images/title-bg.png

5.66 KB | W: | H:

src/assets/images/title-bg.png

1.24 KB | W: | H:

src/assets/images/title-bg.png
src/assets/images/title-bg.png
src/assets/images/title-bg.png
src/assets/images/title-bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/images/title-bg2.png

6.06 KB | W: | H:

src/assets/images/title-bg2.png

1.26 KB | W: | H:

src/assets/images/title-bg2.png
src/assets/images/title-bg2.png
src/assets/images/title-bg2.png
src/assets/images/title-bg2.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,7 +3,7 @@ let FILE_URL = ''
switch (process.env.NODE_ENV) {
case 'production':
IMG_URL = 'http://10.221.1.181:8080/dist/static/'
FILE_URL = '/dist/static/'
FILE_URL = '/quanguo/static/'
break
default:
IMG_URL = 'http://localhost:8080/static/'
......
......@@ -308,7 +308,7 @@ $radius = 2rem
background $color-map(1)
>div
margin-bottom 0.5rem
line-height 1.4rem
line-height 1.2rem
.percent-wrapper
display flex
......
......@@ -90,12 +90,20 @@ export default {
map: 'china',
left: '5%',
top: '5%',
zoom: 1, //当前视角的缩放比例
roam: true, //是否开启平游或缩放
scaleLimit: { //滚轮缩放的极限控制
min: 0.8,
max: 2,
},
label: {
normal: {
show: false,
},
emphasis: {
color: '#fff',
fontSize: Math.floor(screen.height * 2 / 100),
fontFamily: 'Pangmenzhengdao',
}
},
itemStyle: {
......@@ -114,7 +122,8 @@ export default {
regions: [],
},
series: []
}
},
curProvince: null,
}
},
mounted() {
......@@ -133,10 +142,20 @@ export default {
this.map.on('click', (ev) => {
const {name} = ev.data
this.setRegions(name)
this.curProvince = name
this.$emit('select', name)
})
// 点击空白处则取消选中状态
this.map.getZr().on('click', e => {
if (!e.target && this.curProvince) {
const name = this.curProvince
this.setRegions(null)
this.$emit('select', name)
}
})
},
setRegions(name) {
this.curProvince = name
if (!name) {
this.config.geo.regions = []
this.map.setOption(this.config)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment