Hi,
I am getting 400 error while adding hosted feature layer view to the app. Any tip on how to do this is much appreciated!!
var basemapLayer = new ArcGISTiledMapServiceLayer(basemap.url, {
id: "defaultBasemap",
visible: true
});
var dynSvc = new ArcGISDynamicMapServiceLayer("https://services8.arcgis.com/HPJsu0I9OjNDnQ7I/arcgis/rest/services/tl_2020_42_tabblock20_ViewLayer/FeatureServer",
{
"opacity": 0.5
});
this.map.addLayers([basemapLayer, dynSvc])
Thanks
Chitra
It looks like this Feature Layer requires credentials to access.
Does your application expect the user to sign in? If so, should every user able to access the application also be able to access that feature service, or only certain users?
Alternatively, does the application not have a sign in, and anyone using the application should be able to view the layer?
The URL seems to be for a FeatureLayer so try:
var dynSvc = new FeatureLayer("https://services8.arcgis.com/HPJsu0I9OjNDnQ7I/arcgis/rest/services/tl_2020_42_tabblock20_ViewLayer/FeatureServer/0", {"opacity": 0.5});
Hi,
Thanks for the reply. I set the share level to public. After setting it as a featurelayer the error is gone. But the layer is not visible on the map. Any thought on this?
Thanks
Chitra
The layer displays via the online Map Viewer, but there are many complex features at the default minimum scale, so you might want to adjust it so the feature visibility is more appropriate for the type of data.