增加地图最大缩放级别

问题描述 投票:0回答:1

是否可以增加地图最大缩放级别,默认是18,我需要25-30左右的东西。使用最新的React-Leaflet.MaxNativeZoom没有任何作用。MaxNativeZoom没有任何作用。

例如:代码。

<Map center={[55, 55]} zoom={18} maxNativeZoom={30}>
                <TileLayer
                    attribution='&amp;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>
leaflet react-leaflet
1个回答
0
投票

添加 maxZoom 到你的地图上。

<Map center={[55, 55]} zoom={18} maxZoom={30}>
© www.soinside.com 2019 - 2024. All rights reserved.