New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

china-echarts-map

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

china-echarts-map

只存在全国和省份(省级城市)的地图

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

地图范围

只存在全国和省份(省级城市)的地图

Example

获取全国地图

const echarts = require('echarts')
const Map = require('china-echarts-map')
const areaJSON = Map.getAreaJSON()

获取省份地图

const echarts = require('echarts')
const Map = require('china-echarts-map')
// 获取东莞所在省份的地图
const code = Map.getCodeByName('东莞', 'city')
// 或 Map.getCodeByName('广东') // 获取广东省地图
const province = Map.getProvince(code)
const areaJSON = Map.getAreaJSON({type: 'province', map: province.map})
echarts.registerMap(province.map, areaJSON)

API

// 获取省市信息
getMapJSON ()
// 获取地图json, type的值为country或者province
getAreaJSON(area = {type: 'country', map: 'china'})
// 获取省份
getProvince(code)
// 获取城市
getCity(code)
// 通过中文名获取code,type的值为province或者city
getCodeByName(name = '北京', type = 'province')
// 通过拼音获取code,type的值为province或者city
getCodeByPy (pinyin = 'beijing', type = 'province')

FAQs

Package last updated on 11 Feb 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc