npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

datav-geo-selector

v0.1.3

Published

datav-city-pro 组件地理选择器

Downloads

48

Readme

props 说明

{
  UI, // PropTypes.object, 来自 @ali/deact@^0.1.56, 至少包括 { Drawer, Notify, Icon, Loading, Button, MonacoEditor, Select }
  i18n, // PropTypes.object
  className, // PropTypes.string
  navigationCity, // PropTypes.string,当前导航城市(也是 cityOptions 中的 value, centerMap 中的 key)
  setNavigationCity, // PropTypes.func 更新当前导航城市
  cityOptions, // PropTypes.array,导航城市列表 [{value: $navigationCity, label}]
  centerMap, // PropTypes.object,城市中心映射表 {[$navigationCity]: [lat, lng]}
  area, // PropTypes.object,上一次选择区域(可选) {areaType, aoi}
  availableArea, // PropTypes.oneOfType([PropTypes.array, PropTypes.object]), 可用区域 [{geojson}]
  noDataStatus, // PropTypes.bool 无任何可用数据
  cityLoading, // PropTypes.bool 正在载入导航城市列表
  availableAreaLoading, // PropTypes.bool 正在载入可用区域列表
  defaultZoom = 11, // PropTypes.number 地图默认 zoom 值
  minZoom = 7, // PropTypes.number 地图最小 zoom 值
  atlasEndpoint: PropTypes.string, // atlas 地址
  tileUrlTemplate: PropTypes.string, // 瓦片地址
  maxCityArea: PropTypes.number, // 最大面积值(平面公里),若给了该值,自动进行面积校验
}

  // 其中 i18n 包括以下字段
{
    // 地图选择器
    "zoomIn": "放大",
    "zoomOut": "缩小",
    "rectChoose": "方形框选",
    "circleChoose": "圆形框选",
    "polygonChoose": "多边形框选",
    "codeEditor": "范围数据",

    // 代码编辑器
    "geojsonEditorTitle": "场景范围数据",
    "geojsonEditorInfo": "默认展示当前选中范围的 GeoJSON 代码,修改后应用可更新为当前选中范围。",
    "cancel": "取消",
    "apply": "应用",
    "ok": "确定",
    "unsaved": "未应用",

    // 异常状态
    "noDataStatusInfo": "数据未授权或已过期,请联系管理员",
    "noAvailableAreaInfo": "当前数据已过期,可尝试切换至其它数据版本",

  }

实例上可以使用的方法

getArea() // 无参数,范围当前选择器的选择区域,返回结果为一个对象,格式 { areaType, aoi, geojson }
setView(...params) // leaflet 的 setView 方法,参数与 leaflet 用法相同