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);
  • 相关阅读:
    Relax! It's just a game(排列组合,简单)
    Feynman(数学)
    The Center of Gravity(一道很很简单的几何题)
    Game with points(数学,难度中)
    Tempter of the Bone(DFS + 奇偶剪枝,好题)
    [置顶] Card
    Find Terrorists(素数筛选+素因子分解)
    Enemy at the Gateway
    Anindilyakwa(简单)
    ACMer(数学,有意思)
  • 原文地址:https://www.cnblogs.com/aiyouku/p/featureServer.html
Copyright © 2011-2022 走看看