ArcGIS API for JavaScript地图服务打点功能

arcgis地图服务封装地图打点功能

1、初始化地图服务

            dojoRequire(["esri/map", 
            "esri/geometry/Point", ],(Map,Point,)=>{
            window.initPGISLayer()
            map = new Map("map", {
                center : new Point(113.417712153994512,23.224568881656335), // 中心点
                zoom : 8,
                logo : false,
                slider : false,
            })
            var sl_url = "http://10.41.219.142:6080/PGIS_S_TileMapServer/ags/vector/";
            mapLayer1 = new window.esri.layers.CCFPGISLayer(sl_url);
            map.addLayer(mapLayer1);
            this.drawPonit(data);
        })

2、绘制打点功能drawPonit方法

    drawPonit=(data)=>{
        dojoRequire([
            "esri/InfoTemplate",
            "esri/layers/GraphicsLayer",
            "esri/geometry/Point", 
            "esri/SpatialReference",
            "esri/symbols/PictureMarkerSymbol",
            "esri/graphic",
        ],(InfoTemplate,GraphicsLayer,Point,SpatialReference,PictureMarkerSymbol,Graphic)=>{
            drawLayer = new GraphicsLayer({opacity:0.80,id: "mapLayer"});
            map.addLayer(drawLayer,2);
            for(let i=0;i

你可能感兴趣的:(前端,arcgis)