I have a map sitting on top of a dark gray background.

I have the canvas basemap set to initially load as semi-transparent:

 var canvas = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer", {
            "id": "canvas"});

When I zoom in/out, the tiles seem to 'flash' in. Easier to see what I mean by watching this short screencast.

I am guessing it might be to do with the fact that the layer has some kind of fade in transition for new tiles?

If you agree that this is the likely cause, is there any way to turn this effect off?

For info, elsewhere in my application I have a transparency slider for this layer, but this has the same value as the initial transparency of the basemap. The reason I mention this, is that if there is a way the tiles can have their transparency altered perhaps by CSS, this will not be a workaround for me, as the tiles can have their opacity changed by the slider.

            min: 0,
            max: 100,
            value: 28,
            range: "min",
            slide: function(event, ui) {

It's not the fade effect (but you can turn that off with a map constructor option: http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#Map/fadeOnZoom), but rather the fact that semi-transparent images are being stacked and then old images are removed.

When you change zoom levels, new tiles for the new zoom level are loaded. The previous zoom level's tiles aren't removed until the new tiles have loaded. This causes both to be displayed for a moment. When a tiled layer doesn't have any transparency, this isn't an issue. When a tiled layer is semi-transparent, you get the effect you've described.

I don't think there's a way around this (other than not using transparency).

  • Thanks Derek. That makes sense. Was hoping to use canvas baseman but I might have to create my own cache which just shows roads with transparent bg and use png image type. Bit of an overhead but that should work? – jakc Jan 26 '13 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.