Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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", {
            "opacity":0.28,
            "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.

$('#slider').slider({
            min: 0,
            max: 100,
            value: 28,
            range: "min",
            slide: function(event, ui) {
              map.getLayer("canvas").setOpacity(ui.value/100);
          } 
         });
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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).

share|improve this answer
    
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? –  Simon Jan 26 '13 at 11:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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