Geo
中国地理信息GeoJSON,常搭配ECharts5地图组件
Install / Use
/learn @esmjs/GeoREADME
🚀 特性
- 🦀
rust爬虫: 使用rust现代系统编程语言编写爬虫来获取中国地理信息,安全性高、速度快并且并发性高 - 🐹 极快打包: 使用
esbuild打包,本质使用go语言打包,拥有极快的打包速度 - ⚡️ 完全可摇树: 自带
Tree-shaking,只对引入的代码进行打包 - 💫 零依赖: 零
Dependencies依赖,只会安装项目本身 - 🦾 强类型: 使用
TypeScript编写,拥有强大的类型推导提示
📦 安装
# npm
npm install @esmjs/geo
# or yarn
yarn add @esmjs/geo
# or pnpm
pnpm add @esmjs/geo
📕 用法
// 如搭配 ECharts 地图组件,@esmjs/geo 还支持中国全省数据,请看下面的速查表
// import { china as geoChina } from "@esmjs/geo"; // 如有命名冲突使用 as 别名即可
import { china } from "@esmjs/geo";
import * as echarts from "echarts/core";
/**
* 由于 echarts 没有导出 geoJSON 的 GeoJSONSourceInput 类型
* china 只能导出标准的 GeoJSON 格式类型
* 如果你的项目是 TypeScript 编写,下面代码加上 //@ts-expect-error 即可
*/
echarts.registerMap("china", { geoJSON: china });
🌍 使用场景
常用于 ECharts 地图组件
<img src="https://xiaoxian521.github.io/hyperlink/img/echarts-geo.jpg" alt="echarts-geo" width="340" />🇨🇳 速查表
一个中国,34个省级行政区,23个省、5个自治区、4个直辖市、2个特别行政区
| 中国 | 陕西 | 山西 | 辽宁 | 吉林 | 黑龙江 | | :------: | :--------: | :-------: | :-------: | :------: | :----------: | | china | shaanxi | shanxi | liaoning | jilin | heilongjiang | | 江苏 | 浙江 | 安徽 | 福建 | 江西 | 山东 | | jiangsu | zhejiang | anhui | fujian | jiangxi | shandong | | 河南 | 湖北 | 湖南 | 广东 | 海南 | 四川 | | henan | hubei | hunan | guangdong | hainan | sichuan | | 贵州 | 云南 | 河北 | 甘肃 | 青海 | 台湾 | | guizhou | yunnan | hebei | gansu | qinghai | taiwan | | 广西 | 内蒙古 | 西藏 | 宁夏 | 新疆 | 北京 | | guangxi | neimenggu | xizang | ningxia | xinjiang | beijing | | 天津 | 上海 | 重庆 | 香港 | 澳门 | | | tianjin | shanghai | chongqing | hongkong | aomen | |
🤔 FAQ
- 为什么使用
rust编写爬虫程序 - 为什么使用
esbuild打包而不是rollup - 既然是纯
esm包,为什么package.json文件还要加main、module、types配置 - 如何运行
rust爬虫程序 rust相关学习资料- 有么有类似
npmjs的rust包管理器 rust安装环境麻烦,如何通过docker运行rust爬虫程序- 地图数据来源
许可证
Related Skills
himalaya
339.5kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
83.9kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
