在echart中使用bmap的空气质量地图,请问有限制地图缩放级别的api吗? 例如百度地图中的
var map = new BMap.Map("allmap",{minZoom:4,maxZoom:8});
而且我查看了api,只能在实例化的时候设置,这可如何是好!!
请大神指点
在bmap空气质量地图中限制 地图的缩放等级,例如只能缩放8-11级
option = {
backgroundColor: '#404a59',
title: {
text: '',
subtext: '',
sublink: '',
left: 'center',
textStyle: {
color: '#fff'
}
},
tooltip: {
trigger: 'item'
},
bmap: {
center: [104.114129, 37.550339],
roam: true,
mapStyle: {
styleJson: [
{
'featureType': 'water',
'elementType': 'all',
'stylers': {
'color': '#183d95'
}
},
{
'featureType': 'land',
'elementType': 'all',
'stylers': {
'color': '#0f275f'
}
},
{
'featureType': 'boundary',
'elementType': 'all',
'stylers': {
'color': '#3f69c8'
}
},
{
'featureType': 'railway',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'highway',
'elementType': 'geometry',
'stylers': {
'color': '#004981',
'visibility': 'off'
}
},
{
'featureType': 'highway',
'elementType': 'geometry.fill',
'stylers': {
'color': '#005b96',
'lightness': 1,
'visibility': 'off'
}
},
{
'featureType': 'highway',
'elementType': 'labels',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'arterial',
'elementType': 'geometry',
'stylers': {
'color': '#004981',
'visibility': 'off'
}
},
{
'featureType': 'arterial',
'elementType': 'geometry.fill',
'stylers': {
'color': '#00508b',
'visibility': 'off'
}
},
{
'featureType': 'poi',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'green',
'elementType': 'all',
'stylers': {
'color': '#056197',
'visibility': 'off'
}
},
{
'featureType': 'subway',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'manmade',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'local',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'boundary',
'elementType': 'geometry.fill',
'stylers': {
'color': '#3f69c8'
}
},
{
'featureType': 'label',
'elementType': 'labels.text.stroke',
'stylers': {
'color': '#eee'
}
}
]
}
},
series: [
{
name: 'danger',
type: 'effectScatter',
coordinateSystem: 'bmap',
data: convertData(data.filter(function (k) {
if (k.status === 'danger') {
return k
}
})),
symbolSize: function (val) {
return 10
},
rippleEffect: {
brushType: 'stroke'
},
hoverAnimation: true,
label: {
normal: {
formatter: '{b}',
position: 'right',
show: false
},
emphasis: {
show: true
}
},
itemStyle: {
normal: {
color: '#fc4c7c'
}
}
},
{
name: 'warning',
type: 'effectScatter',
coordinateSystem: 'bmap',
data: convertData(data.filter(function (k) {
if (k.status === 'warning') {
return k
}
})),
symbolSize: function (val) {
return 8
},
rippleEffect: {
brushType: 'stroke'
},
hoverAnimation: true,
label: {
normal: {
formatter: '{b}',
position: 'right',
show: false
},
emphasis: {
show: true
}
},
itemStyle: {
normal: {
color: '#f79752'
}
}
}
]
}
暂时可以这么处理:
BMap = myChart.getModel().getComponent('bmap').getBMap();
BMap.setMinZoom(12);
BMap.setMaxZoom(19);
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
暂时可以这么处理:
BMap = myChart.getModel().getComponent('bmap').getBMap();
BMap.setMinZoom(12);
BMap.setMaxZoom(19);