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>
Solved! Go to Solution.
When I insert that service into the ImageryLayer sample, it also errors out. However, I'm getting the errors
/4.2/ (line 137, col 143)Blocked loading mixed active content “http://mobjack.vims.edu/arcgis/rest/services/VIMS_CCRM/Poquoson_3D_Test/ImageServer?f=json&callback=...
which may be due to the fact that the sandbox is https while your service is http (but not https)
When I insert that service into the ImageryLayer sample, it also errors out. However, I'm getting the errors
/4.2/ (line 137, col 143)Blocked loading mixed active content “http://mobjack.vims.edu/arcgis/rest/services/VIMS_CCRM/Poquoson_3D_Test/ImageServer?f=json&callback=...
which may be due to the fact that the sandbox is https while your service is http (but not https)
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
thanks for the help, Ken and Bjorn!