【问题标题】:How we add tile layer on arcgis map?我们如何在 arcgis 地图上添加瓦片层?
【发布时间】:2016-09-09 05:20:43
【问题描述】:

我正在使用 arcgis web app builder 创建一个 arcgis 小部件,现在我遇到了在地图上添加切片图层的问题

 postCreate: function () {
          var this_object = this;
          this.graphicsLayerGSV = new GraphicsLayer();
          this.map.addLayer(this.graphicsLayerGSV);
          this.handlers = [];
          this.img = domConstruct.create("img", null, win.body(), "first");
          this.img.src = this.folderUrl + "images/flying_gsv_man_e.png";
          this.img.style.position = "absolute";
          this.inherited(arguments);
          onsole.clear();
          var socketURL = "ws://192.168.100.109:8082";//this.config.socketUrl;
          console.log('Websocket URL :: ' + this.config.socketUrl);

          var layover = new WebTiledLayer("http://dev.site.com/map/${level}/${row}/${col}.png");
          this.map.addLayer(layover);
          console.log(layover,'is working');

在上面的代码中 this.map.addLayer(this.graphicsLayerGSV) 工作但 this.map.addLayer(layover) 不工作。

【问题讨论】:

    标签: dojo arcgis arcgis-server


    【解决方案1】:

    你遇到了什么错误?

    可能是图层还没有加载,试试这个。

    var layover = new WebTiledLayer("http://dev.alamatint.com/map/${level}/${row}/${col}.png");
    if(layover.loaded){
        this.map.addLayer(layover);
    } else {
        on(layover, "load", lang.hitch(this, function(){
            this.map.addLayer(layover);
        }
    }
    

    确保你有“dojo/on”和“dojo/_base/lang”

    【讨论】:

      猜你喜欢
      • 2018-07-12
      • 2016-03-28
      • 2018-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-08
      • 2017-04-22
      相关资源
      最近更新 更多