I am trying to overlay my basemap with a .gif image using the JavaScript web API version 4.14. I'm using the following code to initialize my MapImage and then add it to a MapImageLayer. I then add the MapImageLayer to my map.
// create an add the actual image
var radarImage = new MapImage({
'extent': { 'xmin': -92.530, 'ymin': 27.361, 'xmax': -97.620, 'ymax': 31.575 },
'href': '/data/layers/weather/high_zoom_ve_layer_weather.gif',
'spatialReference': { 'wkid': 4326 }
});
weatherRadarLayer = new MapImageLayer();
weatherRadarLayer.title = "Weather Radar Layer";
weatherRadarLayer.addImage(radarImage);
map.addLayer(weatherRadarLayer);
My code throws the following error:
Error: "scriptError: https://js.arcgis.com/4.14/esri/views/MapImage.js"
q https://js.arcgis.com/4.14/:5
c https://js.arcgis.com/4.14/:23
4.14:24:471
<anonymous> https://js.arcgis.com/4.14/:24
signal https://js.arcgis.com/4.14/:6
p https://js.arcgis.com/4.14/:4
signal https://js.arcgis.com/4.14/:6
c https://js.arcgis.com/4.14/:23
What am I doing wrong and how can I overlay a .gif image on my map?
Solved! Go to Solution.
Luckily, since my "layer" is a weather radar image, I was able to use the Map Service here to accomplish what I need.
Mike,
In the 4.x API The MapImageLayer class is used for ArcGISDynamicMapServiceLayers (the 3.x name for map service layers). The 4.x API does NOT have any support for adding georeferenced images to the map at this time.
Functionality matrix | ArcGIS API for JavaScript 4.14
MapImageLayer - Coming soon (not to be confused with the 4x MapImageLayer which is the 4x version of the 3x ArcGISDynamicMapServiceLayer)
Luckily, since my "layer" is a weather radar image, I was able to use the Map Service here to accomplish what I need.
Mike, feel free to mark this question as answered, even if you provided the answer yourself.
Hi @MikeV ,
Just want to let you know we are adding support for this at 4.24. You can use MediaLayer (new at 4.24) to add static images or videos on your map. You can test it out using our next version as of today. Please check it out and if you have any questions or feedback please let me know.
https://github.com/Esri/feedback-js-api-next/blob/master/CHANGELOG.md