Map Imagery Not working

Imagery Provider is not working . . .

imageryProvider: new Cesium.ArcGisMapServerImageryProvider({url: "//"})

This was working 6 months ago but suddenly not working. I’m trying to figure out if it may be a change in the map server or provider service? Or is this something on my end?

It’s working you can check this sandcastle link.


Ok, thanks. I see it’s working from the link you provided. I’ll have to do some investigating on my end to figure out what is going on.

EDIT: I’ve tried looking into my .js and html code files, file permissions, server connection status, port number availability. Not finding anything wrong.

Any ideas what this could be?

I can’t say without individually check your code. There can be multiple reasons including firewall blockage. You should check in the “Network” section of your chrome browser’s developer tools. You can check if request is getting response or not. Let us know here if you are catching any error in the console also.

I verified it’s not a firewall issue. There are no error messages in the console.

Maybe explaining my working environment may help. I’m running Cesium 1.44 through nodejs. I start the js server by running >node server.js

nodejs command line

I then open a browser and enter: http://localhost:8080//index.html

In my .html file I include . . .

<script src="CesiumViewer/js/jquery-3.1.1.js"></script>
<script src="Build/Cesium/Cesium.js"></script>
<script src="./myCodeFile.js"></script>

In myCodeFile.js is where I call my Cesium API . . .

var mapType = "//";

var viewer = new Cesium.Viewer('cesiumContainer',
      requestRenderMode : true,
      maximumRenderTimeChange : Infinity,
      targetFrameRate: 30,
      imageryProvider: new Cesium.ArcGisMapServerImageryProvider({url: mapType}),
      terrainProvider: new Cesium.VRTheWorldTerrainProvider({
         url: ""
      animation: false

etc . . .

This has been my setup for the past several years and has worked fine. Now, it’s been about 6 months since I’ve done any work with Cesium and I’ve come back to use it and I’m getting the error above.

I’m not sure why it is not working with you. I have few tips which you can try:

  • Use https with the url of map server.
  • Check Network section in the developers tools to monitor requests status.
  • You can try UrlTemplateImageryProvider also as given in the following code:
const viewer = new Cesium.Viewer("cesiumContainer", {
  imageryProvider: new Cesium.UrlTemplateImageryProvider({url: "{z}/{y}/{x}"}),
  terrainProvider: new Cesium.ArcGISTiledElevationTerrainProvider({
1 Like

Your first suggestion worked! I added https to the beginning of the string.

imageryProvider: new Cesium.ArcGisMapServerImageryProvider({url:"})

Strange that it worked without it for a long time.

Thanks for your help!