loadModules(["esri/graphic", "esri/layers/GraphicsLayer", "esri/symbols/PictureMarkerSymbol", "esri/geometry/Point"]).then(([Graphic, GraphicsLayer, PictureMarkerSymbol, Point]) => { const graphicLayer = new GraphicsLayer(); const dataAll: any[] = [] data.forEach((item: any) => { const { alertType, alertData } = item; alertData.forEach((item: any) => item.type = alertType); dataAll.push(...alertData) }) let symbo = new PictureMarkerSymbol({ "url": img1, "type": "esriPMS", width: 20, height: 19 }); dataAll.forEach(item => { const { type, x, y } = item; let point = new Point({ "x": x, "y": y, "spatialReference": { "wkid": 4490 } }); if (type === '二月预警') { symbo.url = img2 } if (type === '三月预警') { symbo.url = img3 } var graphic = new Graphic(point, symbo, item); graphicLayer.add(graphic) }) map.addLayer(graphicLayer) graphicLayer.on('click', (e: any) => { console.log(e); }) })
正文
Arcgis api3.x加载自定义点
文章版权声明:除非注明,否则均为
譬如朝露_策温技术开发工作室博客原创文章,转载或复制请以超链接形式并注明出处。
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接