const renderer = { type: "heatmap", colorStops: [ { color: "rgba(000,000,255,0)", ratio: 0 }, { color: "rgb(000,000,255)", ratio: 0.45 }, { color: "rgb(000,255,255)", ratio: 0.55 }, { color: "rgb(000,255,000)", ratio: 0.65 }, { color: "rgb(255,255,000)", ratio: 0.95 }, { color: "rgb(255,000,000)", ratio: 1 } ], blurRadius: 10, maxPixelIntensity: 25, minPixelIntensity: 0, } as any; export const createHeat = (view: MapView, res: any) => { let heatArr = res.map((m: any) => { let geometry = m.feature.geometry; let attributes = m.feature.attributes; return { geometry, attributes } }); let layer = new FeatureLayer({ source: heatArr, renderer: renderer, objectIdField: "ObjectID", id: "heatmaplayer" }); console.log(layer, 'layer'); view.map.add(layer) let legend = new Legend({ view: view, container: document.createElement("div"), layerInfos: [ { layer: layer, title: '热力图' } as any ] }); view.ui.add(legend, 'bottom-left'); return heatArr; }
正文
arcgis api4.x热力图
文章版权声明:除非注明,否则均为
譬如朝露_策温技术开发工作室博客原创文章,转载或复制请以超链接形式并注明出处。
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接