map-map3d-earth3d
v0.3.0
Published
地图
Downloads
70
Readme
https://xiuangh.top/app#
- 2D 平面地图
<canvas id="mapdom" style="width:100px;height:100px"></canvas>
import * as Map2d from "map-map3d-earth3d";
//初始化地图
const lMap = new Map2d.Map(document.getElementById('mapdom'), {
zoom: 3,
center: [116.397428, 39.90923]
});
//设置中心点
lMap.setCenter([116.397428, 39.90923])
//设置缩放级别
lMap.setZoom(4)
//监听移动
lMap.on("move", ({ zoom, center }) => {
});
//监听缩放
lMap.on("zoom", ({ zoom, center }) => {
});
//区域热力图层
const layer = new Map2d.MapAreaHeatLayer({
data: json,// geojson
options:{
//每个区域颜色数据
data:[{
"adcode": "440000",//对应的哪个区域
"colorField": 10,
"textureShapeField": "E",
"textureColorField": 10,
"color": "rgba(223,209,168,1)"//区域的颜色
}],
}
});
//添加图层
lMap.addLayer(layer);