Select to view content in your preferred language

Overlay georeferenced image with ArcGIS javascript 4.6

6180
21
02-23-2018 09:08 AM
ChadKahler
Emerging Contributor

With ArcGIS Javascript v3.x you could use a combination of MapImage and MapImageLayer to overlay a georeferenced image on the map.  It appears that the MapImageLayer functionality has changed in the 4.6 Javascript API, so is there a workaround available for georeferenced images until the old v3.x functionality of the MapImageLayer is implemented?

Thanks!

Tags (1)
21 Replies
DavidColey
Honored Contributor

Well, once you have your mapView set up in your js file, you just need to add the correct require 

"esri/layers/MapImageLayer"

and alias

MapImageLayer,

 and then set up a var for the MapImageLayer and add it to your maps layers:

var image = new MapImageLayer({
 url: "http://gem.edcgov.us/arcgis/rest/services/surface/Aerials_2011_mercator_WAB/MapServer"
 });
 /*add the layers!*/
 map.addMany([lyrUtilBnds, lyrEnvBnds, lyrFacBnds, lyrMobBnds, image]);

 not really a workaround per say, it's just the way it works

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

David,

  I think you mis-read the post he is asking about adding a georeferenced image to the map in 4.x

0 Kudos
DavidColey
Honored Contributor

Sure, I don't think I understand what he's asking then.  But other than adding a map image layer or an image service layer, how else would you add an image to a map?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Just the way he said back in 3.x API. The MapImageLayer was for just that back then.

0 Kudos
DavidColey
Honored Contributor

yeah I missed something in his question then.  In looking at 4.x, it looks like some of the old 3.x MapImage properties are now incorporated into the 4.x MapImageLayer?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

3.x

Description

(Added at v2.4)
The MapImageLayer class is used to add georeferenced images to the map. The map will place the georeferenced images at the specified geographic extent. The extent of the image should be within the map's extent. The image should also be in the same coordinate system as the map.
ChadKahler
Emerging Contributor

Thank you all for the feedback!  I probably should have been more specific.  I have utilized the MapImageLayer functionality in 3.x for overlaying a local georeferenced image with success, but I noticed that same functionality doesn't exist yet in 4.x.  According to the ESRI functionality matrix the 3.x MapImageLayer has not been implemented in 4.x, since the 4.x MapImageLayer actually is a conversion of the 3.x ArcGISDynamicMapServiceLayer.

So I guess the main question that I was asking if anyone had figured out a workaround to achieve the 3.x MapImageLayer functionality utilizing the 4.x version of the API.

Perhaps I just need to be patient for the next release!

Thanks again!

RobertScheitlin__GISP
MVP Emeritus

Chad,

   I have not seen any info on the port over of the capability to use a georeferenced image in 4.x yet. I will ask next month at the Dev Summit though.

0 Kudos
ChadKahler
Emerging Contributor

Robert,

Thanks...appreciate it!

On Fri, Feb 23, 2018 at 3:20 PM, Robert Scheitlin, GISP <geonet@esri.com>

0 Kudos