just in title,
code is below, i want to change this map center to show all markers,
and the markers will change,so the center is changing,how to calculate the center and zoom in map? thks for answer
<l-map :zoom="amapContext.map.zoom" :center="amapContext.map.center">
<l-tile-layer
:url="amapContext.map.url"
:attribution="amapContext.map.attribution"
></l-tile-layer>
<l-marker
v-for="(marker, idx) in amapContext.data.markers"
:key="idx"
:lat-lng="marker.position"
:icon="marker.iconShow"
>
<l-popup> 经纬度:{{ marker.position }} </l-popup>
</l-marker>
<!-- <l-marker :lat-lng="[39.996356, 116.480639]"></l-marker> -->
</l-map>
ok, i got a method except it isn't the best solution,
set the map bounds ues two latLngBounds(ref to docs of leaflet) , one latLngBounds is the max lat lng,and the other is min lat lng in markers