Select to view content in your preferred language

Accessing layer (basemap) in ArcGIS Online (prompting credentials)

691
2
02-10-2022 09:49 PM
jkumartry1980
Emerging Contributor

Dear All,

I am developing one application using ArcGIS JS Script 4.22 . In that application I need to use basemap layer of OSI. OSI has provided  a REST service link. When I use that link it asking for username and password. Basemap REST link was published in the ArcGIS online where other feature layers are published. I understand that key is needed to avoid prompting login. Could you please  help me how can I create key in ArcGIS online and how I have use along with the link in the code.

Could you please assist me in this regard, since it is very urgent.

 

Best Regards, 
K.Jayakumar

 

Tags (1)
0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor
0 Kudos
jkumartry1980
Emerging Contributor

Hi,

 

Thanks for the reply. I tried the following code to use this layer as basemap

 

 

 const imageTileLayer = new TileLayer({
                portalItem: {
                    id: "7c57414b0aad4cbc9999ad2be8d9a069"  
                }
            });
            const basemap = new Basemap({
                baseLayers: [
                  imageTileLayer                   
                ]
            });
             map = new Map({
                basemap: basemap          
            });

 

 

 

The particular layer was published in the ArcGIS online (Datasource URL 

https://mapgenie.osi.ie/arcgis/rest/services/WM/basemap_public/MapServer) but I got this error, kindly let me know how to resolve this issue. Please note all other layers are loading without any issue.

Capture.PNG

0 Kudos