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);
  • 相关阅读:
    BZOJ 1707 [Usaco2007 Nov]tanning分配防晒霜
    BZOJ2697:特技飞行
    Bridging signals(NlogN最长上升子序列)
    HDU 4291 A Short problem(矩阵+循环节)
    计蒜之道 初赛第一场B 阿里天池的新任务(简单)
    1008: [HNOI2008]越狱
    1022: [SHOI2008]小约翰的游戏John
    1192: [HNOI2006]鬼谷子的钱袋
    2456: mode
    BZOJ-1968
  • 原文地址:https://www.cnblogs.com/aiyouku/p/featureServer.html
Copyright © 2011-2022 走看看