是否可以增加地图最大缩放级别,默认是18,我需要25-30左右的东西。使用最新的React-Leaflet.MaxNativeZoom没有任何作用。MaxNativeZoom没有任何作用。
例如:代码。
<Map center={[55, 55]} zoom={18} maxNativeZoom={30}>
<TileLayer
attribution='&copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<FeatureGroup>
<EditControl
position='topright'
onCreated={this.onCreated}
/>
</FeatureGroup>
{
this.state.positions.map(position=>(
<Marker
position={[position.lat,position.lng]}
>
</Marker>
))
}
</Map>
添加 maxZoom
到你的地图上。
<Map center={[55, 55]} zoom={18} maxZoom={30}>