当前位置: 首页 > Web前端 > vue.js

arcgisforjs根据经纬度添加图片标注

时间:2023-03-31 19:25:36 vue.js

1.声明三个包esri/layers/GraphicsLayeresri/Graphicesri/geometry/Point2。声明GraphicsLayer并将其添加到地图3.初始化图像标记并将它们添加到GraphicsLayerasyncSh??owLocation(){letthat=thisconstGraphic=awaitarcgisPackage.GraphicconstGraphicsLayer=awaitarcgisPackage.GraphicsLayerconstPoint=awaitarcgisPackage.Pointletlayer=newGraphicsLayer()that.map.add(layer)varsymbol={type:"picture-marker",url:require('../../../assets/img/onepicture/ta.png'),//图片地址width:"64px",height:"64px"};var点=新点(103.880812,27.802255);vargp=newGraphic(point,symbol);层。图形。添加(GP);},