Skip to content

Latest commit

 

History

History
168 lines (105 loc) · 2.36 KB

LayerGroup.md

File metadata and controls

168 lines (105 loc) · 2.36 KB

LayerGroup v1.4.0+

Examples

  • Basic Usage

    import {
      RCMap,
      TileLayer,
      LayerGroup,
      FeatureGroup,
      GeoJSON,
      Point,
      CircleMarker,
      Circle,
      Polyline,
      Polygon,
      Rectangle,
      ImageOverlay,
      VideoOverlay,
      SVGOverlay
    } from 'rc-leaflet'
    
    (
      <RCMap crs center>
        <TileLayer />
        <LayerGroup>
          <Point />
          <CircleMarker />
          <Circle />
          <Polyline />
          <Polygon />
          <Rectangle />
          <ImageOverlay />
          <VideoOverlay />
          <SVGOverlay />
        </LayerGroup>
      </RCMap>
    )
  • 多层嵌套

    (
      <LayerGroup>
        <Circle />
        <LayerGroup />
        <FeatureGroup />
        <GeoJSON />
      </LayerGroup>
    )

Props

  • zIndex

    • type: number

    • required: false

    • 只对Point和基于ImageOverlay的组件起作用

Props inherited from InteractiveLayer

  • interactive

    • type: boolean

    • required: false

    • LayerGroup是否具有交互效果

  • bubblingMouseEvents

    • type: boolean

    • required: false

    • LayerGroup的鼠标事件是否冒泡

Props inherited from Layer

  • pane

    • type: string

    • required: false

    • default: overlayPane

    • 放置LayerGroup的地图图层名称

  • attribution

    • type: string

    • required: false

    • 版权描述

  • onCreate

    • type: (layer: L.Layer) => void

    • required: false

    • LayerGroup创建之后的回调

  • onAdd

    • type: (e: L.LeafletEvent, layer: L.Layer) => void

    • required: false

    • LayerGroup添加到图层之后的回调

  • onUpdate

    • type: (layer: L.Layer) => void

    • required: false

    • LayerGroup发生更新之后的回调

  • onBeforeRemove

    • type: (layer: L.Layer) => void

    • required: false

    • LayerGroup在删除之前的回调

  • onRemove

    • type: (e: L.LeafletEvent, layer: L.Layer) => void

    • required: false

    • LayerGroup删除时的回调

Props inherited from Evented

  • onClick

    • type: (e: L.LeafletMouseEvent) => void

    • required: false

    • LayerGroup鼠标点击时的回调

  • onMouseOver

    • type: (e: L.LeafletMouseEvent) => void

    • required: false

    • LayerGroup鼠标进入时的回调

  • onMouseOut

    • type: (e: L.LeafletMouseEvent) => void

    • required: false

    • LayerGroup鼠标离开时的回调