Hello Friends,
I am using ArcGis Javascript API 4.16 and In my project I am having issue consuming the service https://imagery.pasda.psu.edu/arcgis/rest/services/pasda/NAIP2019/MapServer (Spatial Reference 4269) as a base layer for my basemap. Whereas I am able to consume the following service https://gis.penndot.gov/arcgis/rest/services/basemaps/penndotbasemap/MapServer (Spatial Reference 102100 ). I have tried using both the service in the sandbox https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=intro-mapview and only the one with (SR 102100) is working. Below is the code snippet for utilizing the above services in the code sandbox
require([
"esri/Map",
"esri/views/MapView",
"esri/Basemap",
"esri/layers/MapImageLayer",
"esri/layers/TileLayer"
], function (Map, MapView, Basemap, MapImageLayer, TileLayer) {
var map = new Map({
basemap: new Basemap({
baseLayers: [
new MapImageLayer({
url:
"https://imagery.pasda.psu.edu/arcgis/rest/services/pasda/NAIP2019/MapServer",
title: "Basemap"
})
],
title: "basemap",
id: "basemap"
})
});
For the service with SR 102100
require([
"esri/Map",
"esri/views/MapView",
"esri/Basemap",
"esri/layers/MapImageLayer",
"esri/layers/TileLayer"
], function (Map, MapView, Basemap, MapImageLayer, TileLayer) {
var map = new Map({
basemap: new Basemap({
baseLayers: [
new TileLayer({
url:
"https://gis.penndot.gov/arcgis/rest/services/basemaps/penndotbasemap/MapServer ",
title: "Basemap"
})
],
title: "basemap",
id: "basemap"
})
});
In my project I am adding the above services in the basemap which is made availbel through basemap widget.
Any help on the above issue is much appreciated.
Thank You!
Below issue is similar to the one I am having
https://community.esri.com/t5/arcgis-api-for-javascript/switch-basemap-with-different-wkid-in-basemap-gallery/td-p/567164