Select to view content in your preferred language

Add a layer into ArcGIS map

394
2
Jump to solution
09-22-2024 07:05 AM
LakshanRasingolla
Emerging Contributor

I am trying to add the following layer to my ArcGIS map developed using ArcGIS SDK for JavaScript (V4.30). 

Layer: https://maps2.dcgis.dc.gov/dcgis/rest/services/ROWScan/MapServer

It works correctly when I try using ArcGIS Online map viewer.  I need the ROWScan layer

Screenshot 2024-09-22 192602.png

 

 

 

 

The following is the expected result. 

Screenshot 2024-09-22 192008.png

 

 

I tried to add this as a feature layer which was not successful. Please explain the type of this layer and how to add this to the ArcGIS map using the SDK. 

 

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Sage_Wall
Esri Contributor

Hi @LakshanRasingolla ,

The layer you are trying to add is from a cached MapService.  You have a couple options to add this layer to a map.  One and most performant way (taking advantage of the pre-made tiles) is to create a TileLayer, but in order to do this you will need a basemap in the spatial reference of the cached service, in this case WKID 26985 (Maryland NAD83) which may not be easy to find.

Your second option would be to bring this in as a MapImageLayer which should reproject the data and show it on the map.  The third option would be to create a FeatureLayer from the `0` sublayer "https://maps2.dcgis.dc.gov/dcgis/rest/services/ROWScan/MapServer/0" for the Washington DC Boundary.

Codepen that shows the three layers you can create from this service: https://codepen.io/sagewall/pen/qBeBabz

View solution in original post

2 Replies
Sage_Wall
Esri Contributor

Hi @LakshanRasingolla ,

The layer you are trying to add is from a cached MapService.  You have a couple options to add this layer to a map.  One and most performant way (taking advantage of the pre-made tiles) is to create a TileLayer, but in order to do this you will need a basemap in the spatial reference of the cached service, in this case WKID 26985 (Maryland NAD83) which may not be easy to find.

Your second option would be to bring this in as a MapImageLayer which should reproject the data and show it on the map.  The third option would be to create a FeatureLayer from the `0` sublayer "https://maps2.dcgis.dc.gov/dcgis/rest/services/ROWScan/MapServer/0" for the Washington DC Boundary.

Codepen that shows the three layers you can create from this service: https://codepen.io/sagewall/pen/qBeBabz

LakshanRasingolla
Emerging Contributor

Great work! @Sage_Wall Thanks. 

0 Kudos