All Projects → natee → Highcharts China Geo

natee / Highcharts China Geo

Highcharts 中国地图,Highcharts 中国省市地图,Highcharts China Map,南海诸岛geo

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Highcharts China Geo

City Geo
🌄 中国城市经纬度数据。
Stars: ✭ 196 (+575.86%)
Mutual labels:  china, geo, city
CXProvincesMapView
一个基于PaintCode绘制的中国省份地图框架
Stars: ✭ 49 (+68.97%)
Mutual labels:  map, china
google streetview
A command line tool and module for Google Street View Image API
Stars: ✭ 77 (+165.52%)
Mutual labels:  map, city
mapchina
R Package of Geospatial Shapefile of China Administrative Divisions to the County/District-Level.
Stars: ✭ 60 (+106.9%)
Mutual labels:  map, china
d3-geomap
A library for creating geographical maps based on D3.js
Stars: ✭ 124 (+327.59%)
Mutual labels:  map, geo
font-gis
Icon font and SVG for use with GIS and spatial analysis tools
Stars: ✭ 121 (+317.24%)
Mutual labels:  map, geo
PHPCoord
PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points
Stars: ✭ 78 (+168.97%)
Mutual labels:  map, geo
Administrative Divisions Of China
中华人民共和国行政区划:省级(省份直辖市自治区)、 地级(城市)、 县级(区县)、 乡级(乡镇街道)、 村级(村委会居委会) ,中国省市区镇村二级三级四级五级联动地址数据。
Stars: ✭ 11,727 (+40337.93%)
Mutual labels:  china, city
ClimateChangeProjections
An embeddable map that shows climate change projections. How hot will it be by 2070 if we don't do something about it? Accessible at https://climatechange.codeforafrica.org
Stars: ✭ 29 (+0%)
Mutual labels:  map, geo
zoning
中华人民共和国行政区划:省级(省份直辖市自治区)、 地级(城市)、 县级(区县)、 乡级(乡镇街道)、 村级(村委会居委会)
Stars: ✭ 110 (+279.31%)
Mutual labels:  china, city
django-leaflet-admin-list
The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango.
Stars: ✭ 28 (-3.45%)
Mutual labels:  map, geo
Mapsui
Mapsui is a .NET Map component for WPF, Xamarin.Forms, Xamarin.Android, Xamarin.iOS and UWP
Stars: ✭ 447 (+1441.38%)
Mutual labels:  geo, map
China Geojson
最新中国地图json文件,可用d3开发中国地图
Stars: ✭ 181 (+524.14%)
Mutual labels:  china, map
openfairdb
Open Fair DB is the CreativCommons Backend of Kartevonmorgen.org
Stars: ✭ 53 (+82.76%)
Mutual labels:  map, geo
Area Puppeteer
基于 puppeteer 的中国行政区域抓取爬虫
Stars: ✭ 144 (+396.55%)
Mutual labels:  china, city
arboles
Mapa de Arbolado Urbano
Stars: ✭ 13 (-55.17%)
Mutual labels:  map, city
Province City China
🇨🇳最全最新中国【省、市、区县、乡镇街道】json,csv,sql数据
Stars: ✭ 993 (+3324.14%)
Mutual labels:  china, city
World Cities
Multilingual list of countries, states & cities in XML format. 世界所有城市,国内所有省、市、区、县信息(2020.06)
Stars: ✭ 64 (+120.69%)
Mutual labels:  china, city
mbmatch
An MBTiles server for PBF, which is also a map matcher.
Stars: ✭ 34 (+17.24%)
Mutual labels:  map, geo
Election Geodata
Precinct shapes (and vote results) for US elections past, present, and future
Stars: ✭ 289 (+896.55%)
Mutual labels:  geo, map

Highcharts-china-geo

Highcharts 中国地图和中国各省市(下至县级市、区)地图 geo 数据。

数据

  • latlng/ :地图的经纬度坐标geo数据,来自阿里云 DavaV
  • highmaps/ :转换后的 js 文件,可直接拷贝至项目中使用。

说明

  • 文件名以 行政区域代码.js 方式命名,所以需先了解中国行政区域代码
  • 请求的行政区域包含子区域时,文件名为 ${adcode}_full.js,如:北京市
  • 请求的行政区域不包含子区域,文件名为 ${adcode}.js,如:东城区

特别说明

  • info/china.json 来自于 ECharts 及其它途径的综合处理,是一份把南海诸岛单独作为右下角区域展示的地理数据,格式和 DataV 不一致,经过处理后生成可用文件位于 highmaps/china.js
  • info/hainan_geo.json 是把海南省三沙市(即把南海诸岛)部分删除的地理数据,经过处理后生成可用文件位于 highmaps/hainan.js

如果你使用的是 china.js 说明没有把三沙市算作海南省,那么钻取到海南省时,需请求 hainan.js,你也可以不需要 hainan.js,而是请求 460000_full.js 后用 JavaScript 语法把三沙市剔除。

使用方法

拷贝 highmaps 目录至你的项目中。

这里我们以请求中国地图为例。

const adcode = 100000; // 中国
// adcodeInfo 获取方法见 Q & A
const hasChildren = adcodeInfo[adcode] === true
const fileName = `${adcode}${hasChildren ? '_full': ''}`
await loadMapData(`/highmaps/${fileName}.js`);

const mapData = Highcharts.maps[`countries/cn/${fileName}`];

// 用两层可以方便的单独控制省市名称和数值的展示
const options = {
    series: [{
        // 底图,控制地名,你完全可以不要
        data: [],
        joinBy: 'adcode',
        mapData: mapData,
        enableMouseTracking: false,
        dataLabels: {
            format: "{point.name}"
        }
    },
    {
        // 控制数值
        data: [],
        mapData: mapData,
        joinBy: 'adcode',
        name: 'name1'
    }]
}

详细代码可以参看 /demo/index.html

在线示例

Highcharts 中国地图示例

Q & A

  1. 如何修改 joinBy

    答:Highcharts 中 joinBy 使用的名称这里默认生成为 adcode,如需修改可以自行构建

  2. 怎么判断应该用 ${code}_full.js 还是 ${code}.js

    答:如果请求数据的时候你已经知道是不是最小粒度那直接判断即可。如果你还没有办法判断,那么 utils/infos.json 文件列出了所有的行政区域相关信息,你可以通过这份文件判断一个行政区域是否有子区域。你需要做的就是通过这份文件处理得到一个你想要的对象,如: adcodeInfo = { 100000: true, 110101: false},你也可以通过 adcode 的规则来判断。

  3. 南海诸岛怎么显示在右下角?

    答:当你需要把南海诸岛显示在右下角时,请求地图数据换成 highmaps/china.js,而不是 highmaps/100000_full.js

自定义构建

  1. npm install 安装依赖包
  2. npm run clear_mapjs 删除现有 highmaps/*.js
  3. 可选,如果你需要更新原始 geo 数据
    1. npm run clear_mapgeo 删除现有文件
    2. npm run download 重新从 DataV 下载 geo 文件,一次执行可能有些会失败,多执行几次,直至无报错即可
  4. npm run transfer [joinBy]joinBy 为自定义的值,不传默认为 adcode

许可证

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].