Reputation: 635
I am creating a arcgis widget using arcgis web app builder, now i m facing a problem to add tile layer on map.
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');
In above code this.map.addLayer(this.graphicsLayerGSV) is working but this.map.addLayer(layover) is not working.
Upvotes: 0
Views: 121
Reputation: 1387
What error are you getting?
May be the layer has not loaded yet try this.
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);
}
}
Ensure you have "dojo/on" and "dojo/_base/lang"
Upvotes: 0