zoukankan      html  css  js  c++  java
  • join数据库-featureServer地图编辑

    1、新增—— //新Graphic需要几何geometry和属性attributes
                          //可以是newGraphics ,也可以是newGraphic 
                    var newGraphics = [];
     
                    dojo.forEach(map.graphics.graphics, function (graphic) {
                        var newGraphic = new esri.Graphic(graphic.geometry, null, newAttributes);
                        newGraphics.push(newGraphic);
                    });
    //featureLayer= new esri.layers.FeatureLayer("http://192.168.30.28/ArcGIS/rest/services/shopSecond/FeatureServer/1");
                   featureLayer.applyEdits(newGraphics, null, null); //增加 applyEdits(<Graphic[]> adds, null, null);
     
    2、  var landusePointLayer = new esri.layers.FeatureLayer("http://192.168.30.28/ArcGIS/rest/services/shopSecond/FeatureServer/1", {
            mode: esri.layers.FeatureLayer.MODE_ONDEMAND,     
            outFields: ["*"],
            //        opacity: 0.5,
            id: "HotspotLayer"
        });
        map.addLayers([landusePointLayer]);
     
     
        dojo.connect(map, "onLayersAddResult", initEditing);
     
    3、删除——  featureLayer.applyEdits(null, null, [evt.graphic]); //删除 applyEdits(null,  null ,<Graphic[]> deletes );   
    4、修改—— featureLayer.applyEdits(null, [evt.graphic], null); //修改 applyEdits(null, <Graphic[]> updates, null);
     
    5、有三层数据得到地理数据
    photoInfoData的创建……
    popupTemplate的创建……
     
      var pt = new esri.geometry.Point(photoInfoData[i].x, photoInfoData[i].y, map.spatialReference); //问题第一部分主要出在这里
                 var evtSymbol = new esri.symbol.SimpleMarkerSymbol().setColor("red");
                var graphic = new esri.Graphic(pt, evtSymbol, photoInfoData[i].attributes);
                graphic.setInfoTemplate(popupTemplate);
                countiesGraphicsLayer.add(graphic);
  • 相关阅读:
    SQL基础复习03--数据查询SQL语句(单表查询)
    SQL基础复习02--数据操纵SQL语句
    数据结构与算法01--复杂度
    SQL基础复习01--SQL基础与数据定义SQL语句
    Azure Data Studio的初步了解与使用
    ASP.NET Core Web API 使用DynamicLinq实现排序功能
    Vue3-说说Vue 3.0中Treeshaking特性?举例说明一下?
    JavaScript高频手写面试题
    Java常用文件操作-1
    Java 架构师之路(2)
  • 原文地址:https://www.cnblogs.com/aiyouku/p/featureServer.html
Copyright © 2011-2022 走看看