【问题标题】:Increase map max zoom level增加地图最大缩放级别
【发布时间】:2023-04-05 02:50:01
【问题描述】:

是否可以增加地图最大缩放级别?默认情况下它是 18,但我需要大约 25-30 的东西。 使用最新的 React-Leaflet,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>

【问题讨论】:

    标签: reactjs leaflet react-leaflet


    【解决方案1】:

    maxZoom 添加到您的地图。

    <Map center={[55, 55]} zoom={18} maxZoom={30}>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-26
      • 2015-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-08
      相关资源
      最近更新 更多