setOptions() {
var option = {
// backgroundColor: 'red',
tooltip: {
trigger: 'item',
padding: 0,
enterable: true,
show: true,
triggerOn: 'none',
transitionDuration: 1,
textStyle: {
color: 'red',
decoration: 'none'
},
// position: function (point, params, dom, rect, size) {
// return [point[0], point[1]];
// },
formatter: function(params) {
var tipHtml = '
' + '' + '
'
return tipHtml
}
},
bmap: {
center: [120.122308, 30.298103],
zoom: 12,
roam: true,
background: '#33345F',
mapStyle: {
styleJson: [
{
'featureType': 'water',
'elementType': 'all',
'stylers': {
'color': '#031628'
}
},
{
'featureType': 'land',
'elementType': 'geometry',
'stylers': {
'color': '#000102'
}
},
{
'featureType': 'highway',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'arterial',
'elementType': 'geometry.fill',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'arterial',
'elementType': 'geometry.stroke',
'stylers': {
'color': '#0b3d51'
}
},
{
'featureType': 'local',
'elementType': 'geometry',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'railway',
'elementType': 'geometry.fill',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'railway',
'elementType': 'geometry.stroke',
'stylers': {
'color': '#08304b'
}
},
{
'featureType': 'subway',
'elementType': 'geometry',
'stylers': {
'lightness': -70
}
},
{
'featureType': 'building',
'elementType': 'geometry.fill',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'all',
'elementType': 'labels.text.fill',
'stylers': {
'color': '#857f7f'
}
},
{
'featureType': 'all',
'elementType': 'labels.text.stroke',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'building',
'elementType': 'geometry',
'stylers': {
'color': '#022338'
}
},
{
'featureType': 'green',
'elementType': 'geometry',
'stylers': {
'color': '#062032'
// 'visibility': 'off'
}
},
{
'featureType': 'boundary',
'elementType': 'all',
'stylers': {
'color': '#465b6c'
}
},
{
'featureType': 'manmade',
'elementType': 'all',
'stylers': {
'color': '#022338'
}
},
{
'featureType': 'label',
'elementType': 'all',
'stylers': {
// 'visibility': 'off'
}
},
{
'featureType': 'poi',
'elementType': 'all',
'stylers': {
'color': '#022338'
// 'visibility': 'off'
}
}
]
}
},
series: [
{
name: '北京',
type: 'scatter',
coordinateSystem: 'bmap',
// data: this.convertData(this.data),
symbolSize: function(val) {
return val[2] / 10
},
label: {
normal: {
formatter: '{b}',
position: 'right',
show: false
},
emphasis: {
show: true
}
},
itemStyle: {
normal: {
color: 'purple'
}
}
},
{
name: '北京',
type: 'effectScatter',
coordinateSystem: 'bmap',
data: [
{
name: '北京',
value: [120.122308, 30.298103]
}
],
symbolSize: function(val) {
return 20
},
showEffectOn: 'render',
rippleEffect: {
brushType: 'stroke'
},
hoverAnimation: true,
label: {
normal: {
formatter: '{b}',
position: 'right',
show: true
}
},
itemStyle: {
normal: {
color: '#50E3C2',
shadowBlur: 10,
shadowColor: '#333'
}
},
zlevel: 1
}
]
}
this.myEacharts.setOption(option)
var bmap = this.myEacharts.getModel().getComponent('bmap').getBMap()
},