1.0.1 • Published 11 months ago

map-pro v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
11 months ago

demo

安装

$ npm install map-pro

使用

import mapPro from 'map-pro';

let full
let border
await fetch("https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=110000_full")
    .then(r => r.json())
    .then(r => full = r)

await fetch("https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=110000")
    .then(r => r.json())
    .then(r => border = r)

const cfg = {
    echarts: echarts,
    width: 500,
    height: 500,
    geoJson: {
        border: border,
        full: full,
        mapName: "北京市",
    },
    animate: {
        show: true,
        constantSpeed: 150,
        trailLength: 0.8,
        symbolSize: 4,
        delay: 500,
        color: "rgba(255,255,255,0.8)",
    },
};
const {mapSvg, shapesList, geoUtils, cityList} = mapPro(cfg);
echarts.registerMap("北京市", {svg: mapSvg});
1.0.1

11 months ago

1.0.0

11 months ago