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);
  • 相关阅读:
    使用dom4j 解析xml
    xml schema 建立xml文档
    xml dtd 约束建立xml文档
    DBCP 连接池的使用
    c++面向过程和面向对象-C++编译器是如何管理类和对象的
    c++读取文本文件
    一个范围的两个数进行数位的累加,实现对两个数num1和num2的数位和相加
    C++批量注释代码段取消注释代码段快捷键
    利用MATLAB截取一张复杂图片中想要的区域
    python学习之路系列
  • 原文地址:https://www.cnblogs.com/aiyouku/p/featureServer.html
Copyright © 2011-2022 走看看