AnsweredAssumed Answered

WebApp Builder - Adding layers

Question asked by thewabbit on Jun 28, 2015
Latest reply on Jun 29, 2015 by thewabbit

Hi All

 

I'm working on developing a widget for Web App builder and what i'm trying to do is add a layer that has been created by the user in the web browser. In he JS API you can do something along the lines of:

map.addLayer();

 

However this is not working with the WebApp Builder. Below is the code I currently have with hard coded points:

var facilitiesGraphicsLayer = new GraphicsLayer();
facilitiesGraphicsLayer.setRenderer(Renderer);
facilitiesGraphicsLayer.add(new Graphic(new Point(1460355.1631064715,5082544.779264613,_viewerMap.__tileInfo.spatialReference))); /facilitiesGraphicsLayer.add(new Graphic(new Point(1564363.8936586068,5184488.835737464,_viewerMap.__tileInfo.spatialReference)));
facilitiesGraphicsLayer.add(new Graphic(new Point(1577894.9077129958,5222140.389124587,_viewerMap.__tileInfo.spatialReference))); 
facilitiesGraphicsLayer.add(new Graphic(new Point(1655876.6269847318,5306365.449387112,_viewerMap.__tileInfo.spatialReference))); 
facilities = new FeatureSet();
facilities.features = facilitiesGraphicsLayer.graphics;

 

What I am after is (with a button press) the points in the facilities feature set to be added to the map.

 

Any help is appreciated

 

Cheers

 

Hamish

Outcomes