2016-05-13 141 views
0

我正在使用arcgis web應用程序構建器創建一個arcgis小部件,現在我正面臨在地圖上添加瓷磚層的問題。我們如何在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(遮掩)不工作。

回答

0

你得到了什麼錯誤?

可能是圖層尚未加載尚未嘗試此操作。

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); 
    } 
} 

確保您有 「道場/ ON」 和 「道場/ _base /郎」