思路:
用AMap.DistrictSearch搜索某个(省份、城市、县)返回它的边界坐标集合,使用这个结果,用AMap.Polygon绘制边界线和遮盖,最后使用AMap.Heatmap绘制热力图
高德地图api参考链接:
AMap.DistrictSearch:
https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.DistrictSearch
AMap.Polygon
https://lbs.amap.com/api/javascript-api/reference/overlay#polygon
AMap.Heatmap
https://lbs.amap.com/api/javascript-api/reference/layer#m_AMap.Heatmap
以下是使用北京市做的例子的完整代码
拥挤正常稀疏
结果:
