当我尝试放大标记时遇到问题,出现错误:
var rotas = L.geoJSON(paradas, {
onEachFeature: onEachFeature
}).addTo(map);
function onEachFeature(feature, layer){
layer.on('click', function(e){
$('.orange').html(feature.properties.nome);
$('.city').html(feature.properties.imagem);
$('.event').html(feature.properties.descricao);
console.log(e.target);
zoomToFeature(e)
});
}
function zoomToFeature(e) {
console.log("pass here")
map.fitBounds(e.target.getBounds());
}
但当我做console.log时,它会正确返回。我错了什么?我的源代码在这里:
http://github.com/eltonsantos/analise_integrada
map.fitbunds显示正常,但仍然不起作用:(
有人帮我吗?谢谢!