当多边形建筑物面积比较小时,无法触发悬停交互,显示不了tooltip
配置项如下
var uploadedDataURL = "/asset/get/s/data-1525228494244-r1L0XjI6z.json";
mapboxglToken = 'pk.eyJ1IjoiY29zbWljeSIsImEiOiJjamJlaDh1N2MwdmIwMnlxd2dmZjk0Z2piIn0.7NsKZk03PzpvpJ4EXUDVwQ';
mapboxgl.accessToken = mapboxglToken;
$.getJSON(uploadedDataURL, function(buildingsGeoJSON) {
var bdJson = buildingsGeoJSON.features.map(f => {
if (!f.properties.hasOwnProperty('name')) {
f.properties.name = f.id;
}
if (!f.properties.hasOwnProperty('height')) {
f.properties.height = 30;
} else {
f.properties.height += 30;
}
});
echarts.registerMap('buildings', buildingsGeoJSON);
regionsData = buildingsGeoJSON.features.map(function(feature) {
return {
name: feature.properties.name,
value: Math.random(),
height: feature.properties.height
};
});
myChart.setOption({
tooltip: {
show: true,
},
mapbox: {
center: [120.234756, 30.229959],
zoom: 13,
pitch: 50,
bearing: -10,
silent: false,
//altitudeScale: 400,
style: 'mapbox://styles/mapbox/dark-v9',
postEffect: {
//enable: true,
// FXAA: {
// enable: true
// },
// SSAO: {
// enable: true,
// intensity: 1.2,
// radius: 10
// },
// screenSpaceReflection: {
// enable: true
// }
},
light: {
main: {
intensity: 1,
shadow: false,
shadowQuality: 'high'
},
ambient: {
intensity: 0.
},
ambientCubemap: {
texture: '/asset/get/s/data-1491838644249-ry33I7YTe.hdr',
exposure: 1,
diffuseIntensity: 0.5,
specularIntensity: 2
}
}
},
// geo3D:{},
series: [{
type: 'map3D',
coordinateSystem: 'mapbox',
map: 'buildings',
data: regionsData,
shading: 'realistic',
silent: false,
realisticMaterial: {
metalness: 1,
roughness: 0.2,
}
},
]
});
// var maptalksIns = myChart.getModel().getComponent('maptalks').getMaptalks();
// maptalksIns.on('click', function(e) {
// console.log(e)
// })
});
window.addEventListener('resize', function() {
myChart.resize();
});