AnsweredAssumed Answered

Layer display problems

Question asked by GoMap@Arnt on Jun 11, 2016
Latest reply on Jun 14, 2016 by GoMap@Arnt

Hello!

 

I'm making an app that's using some of the ArcGIS/ESRI features and the JavaScript API.

 

I've managed to create a new Web Map where I added my own Map Notes layer.  On that layer I marked up my content using the Area and Text tool. I applied my styles to them so they're not all the same color and saved the layer/map.

 

After reading for a bit, I found out that to get them displayed on my base map I needed to import the layer service and apply it to my map view in JS.

require(["esri/Map",
         "esri/views/MapView",
         "esri/layers/FeatureLayer",
         "dojo/domReady!"
        ], function (Map, MapView, FeatureLayer) {
    var featureLayer = new FeatureLayer({
        url: "http://services.arcgis.com/MyID/arcgis/rest/services/MyLayerName/FeatureServer/3",
        outFields: ['*']
    });
    var map = new Map({
        basemap: "topo",
        layers: [featureLayer]
    });
    var view = new MapView({
        container: "areaMap",
        map: map,
        zoom: 13,
        center: [13.1835075, 65.8429693]
    });
});

This thing works really well however once I published the layer I had created it seems to have lost all the styling and settings I set to the different Area shapes, not to mention that the text fields I had up with them are gone. What have I done wrong here?

 

Alternatively, I read through the 4.0 Documentation that you can directly load a WebMap as well through Javascript but when I try to load my custom map with my Feature Layer attached to it, the layers seem to not load at all.

 

I'd appreciate any help on this as I've been hitting my head against the wall since Thursday trying to fix this now.

Thank you!

Outcomes