Problem adding an image service to a web scene

1521
3
Jump to solution
12-21-2016 12:19 PM
DanielSchatt
New Contributor III

hi all, I'm using Javascript 4.1 for the first time and just trying create a very basic web scene with my own image service overlain on the default world elevation layer. The world elevation layer shows up fine but my own image service (added as an ImageryLayer) isn't visible. I get an error "ERR_CONNECTION_RESET" for the ImageryLayer url line of code. Apparently for some reason it can't access the service.  But it was accessible and visible from the Javascript viewer on the REST page.  Wondering if it might be a problem with my coding (below). Thanks!

  <script>
    require([
      "esri/Map",
      "esri/views/SceneView",
      "esri/layers/ImageryLayer",

      "dojo/on",
      "dojo/dom",
      "dojo/domReady!"
    ], function(Map, SceneView, ImageryLayer, on, dom) {
        
      // Create inundation layer and add to the map
      var floodLayer = new ImageryLayer({
        url: "http://mobjack.vims.edu/arcgis/rest/services/VIMS_CCRM/Poquoson_3D_Test/ImageServer",
      });

      // Create the Map
      var map = new Map({
        basemap: "topo",
        ground: "world-elevation",
        layers: [floodLayer]
      });

      // Create the MapView
      var view = new SceneView({
        container: "viewDiv",
        map: map,
        camera: {
          position: [-76.407, 37.149, 1346],
          heading: 300,
          tilt: 60
        }
      });

    });
  </script>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

When I insert that service into the ImageryLayer sample, it also errors out. However, I'm getting the errors

Blocked loading mixed active content “http://mobjack.vims.edu/arcgis/rest/info?f=json”
/4.2/ (line 137, col 143)

which may be due to the fact that the sandbox is https while your service is http (but not https)

View solution in original post

3 Replies
KenBuja
MVP Esteemed Contributor

When I insert that service into the ImageryLayer sample, it also errors out. However, I'm getting the errors

Blocked loading mixed active content “http://mobjack.vims.edu/arcgis/rest/info?f=json”
/4.2/ (line 137, col 143)

which may be due to the fact that the sandbox is https while your service is http (but not https)

BjornSvensson
Esri Regular Contributor

Correct Ken Buja, that service doesn't support https (which is required in the sandbox).  
dschall  : It works fine if you try it at http://jsbin.com/sohigiqohu/edit?html,output   

DanielSchatt
New Contributor III

thanks for the help, Ken and Bjorn!

0 Kudos