Socket
Socket
Sign inDemoInstall

@esmjs/geo

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @esmjs/geo

中国地理信息(GeoJSON)


Version published
Maintainers
1
Created

Changelog

Source

1.0.0 (2023-12-01)

🎫 Feat

  • rust方面:支持爬取全国各省数据;代码全量抽离,方便二次开发;优化打印信息;使用 path_abs 处理路径,支持跨平台系统;类型补全

  • typescript@esmjs/geo 功能方面:导出中国和全省数据,支持下钻到省,在地图上显示某省的市;添加 速查表,方便使用者查阅;常见问题和相关知识查阅 FAQ

Readme

Source

@esmjs/geo

@esmjs/geo
中国地理信息(GeoJSON)

NPM version

🚀 特性

  • 🦀 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 地图组件

echarts-geo

🇨🇳 速查表

一个中国,34个省级行政区,23个省、5个自治区、4个直辖市、2个特别行政区

中国陕西山西辽宁吉林黑龙江
chinashaanxishanxiliaoningjilinheilongjiang
江苏浙江安徽福建江西山东
jiangsuzhejianganhuifujianjiangxishandong
河南湖北湖南广东海南四川
henanhubeihunanguangdonghainansichuan
贵州云南河北甘肃青海台湾
guizhouyunnanhebeigansuqinghaitaiwan
广西内蒙古西藏宁夏新疆北京
guangxineimengguxizangningxiaxinjiangbeijing
天津上海重庆香港澳门
tianjinshanghaichongqinghongkongaomen

🤔 FAQ

许可证

MIT © 2023-present, esmjs

Keywords

FAQs

Last updated on 01 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc