Select to view content in your preferred language

ImageryLayer getImageUrl() method alternative in 4.X SDK?

100
4
Tuesday
DenisRomanovas
Occasional Contributor

Good afternoon,

In SDK 3.X there was simple but very useful method: getImageUrl(extent, width, height, callback) [https://developers.arcgis.com/javascript/3/jsapi/arcgisimageservicelayer-amd.html#getimageurl]

Does ImageryLayer have something similar in SDK 4.X?

I want to get url/src (exportImage request) for specific extent, width, height. It looks like SDK 4.X regressed in this area...

0 Kudos
4 Replies
Noah-Sager
Esri Regular Contributor

Hi @DenisRomanovas, thanks for posting your question here. Is this the method you're looking for?
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#getImage...

 

0 Kudos
DenisRomanovas
Occasional Contributor

Thank you. I am afraid it is totally different method under the same name..

0 Kudos
Noah-Sager
Esri Regular Contributor

Sorry, not my area of expertise, just trying to help. It sounds like what you want is this REST operation?
https://developers.arcgis.com/rest/services-reference/enterprise/export-image/

Which is kinda similar to this?
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#fetchPix...

 

DenisRomanovas
Occasional Contributor

Oh, I think you were close. Maybe I needed fetchImage() [now deprecated], which probably works like fetchImage() in WMSLayer (https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-s-createexportimage...

But I was impatient a bit and generated needed url manually... 🙂

Thank you for reply!

0 Kudos