Skip to content

Latest commit

 

History

History
193 lines (121 loc) · 2.57 KB

Tooltip.md

File metadata and controls

193 lines (121 loc) · 2.57 KB

Tooltip

Examples

  • Basic Usage

    import {
      RCMap,
      TileLayer,
      Point,
      LayerGroup,
      FeatureGroup,
      GeoJSON,
      CircleMarker,
      Circle,
      Polyline,
      Polygon,
      Rectangle,
      ImageOverlay,
      VideoOverlay,
      SVGOverlay,
      Tooltip
    } from 'rc-leaflet'
    
    (
      <RCMap crs center>
        <TileLayer />
    
        {/* 支持JSX */}
        <Tooltip position>
          <div />
          <List />
        </Tooltip>
    
        <LayerGroup>
          <Tooltip />
        </LayerGroup>
    
        <FeatureGroup>
          <Tooltip />
        </FeatureGroup>
    
        <GeoJSON>
          <Tooltip />
        </GeoJSON>
    
        <CircleMarker>
          <Tooltip />
        </CircleMarker>
    
        <Circle>
          <Tooltip />
        </Circle>
    
        <Polyline>
          <Tooltip />
        </Polyline>
    
        <Polygon>
          <Tooltip />
        </Polygon>
    
        <Rectangle>
          <Tooltip />
        </Rectangle>
    
        <ImageOverlay>
          <Tooltip />
        </ImageOverlay>
    
        <VideoOverlay>
          <Tooltip />
        </VideoOverlay>
    
        <SVGOverlay>
          <Tooltip />
        </SVGOverlay>
      </RCMap>
    )

Props

  • position

    • type: L.LatLngExpression

    • required: false

    • 当在地图上绑定Tooltip时需要设置position

  • direction

    • type: 'right' | 'left' | 'top' | 'bottom' | 'center' | 'auto'

    • required: false

    • Tooltip显示的位置, 如果没有设置, 则根据情况在左边或右边显示

  • permanent

    • type: boolean

    • required: false

    • 永久打开Tooltip还是只在鼠标悬浮时打开

  • sticky

    • type: boolean

    • required: false

    • Tooltip是否跟随鼠标移动

  • interactive

    • type: boolean

    • required: false

    • Tooltip是否具有交互效果

  • opacity

    • type: number

    • required: false

    • Tooltip的透明度

  • onOpen

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

    • required: false

    • Tooltip打开时的回调

  • onClose

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

    • required: false

    • Tooltip关闭时的回调

Props inherited from DivOverlay

  • className

    • type: string

    • required: false

    • 设置TooltipclassName

  • offset

    • type: [number, number] | L.Point

    • required: false

    • 当在overlay上打开Tooltip时的偏移值

  • zoomAnimation

    • type: boolean

    • required: false

    • 缩放动画

Props inherited from Layer

  • pane

    • type: string

    • required: false

    • default: tooltipPane

    • 放置Tooltip的地图图层名称

  • attribution

    • type: string

    • required: false

    • 版权描述