VDS Technologies

 

Redraw on Postback without Flicker

7/3/2012 9:56:19 AM
Total Posts 11

Redraw on Postback without Flicker

Good day,

I would like to request assistance with regard to getting the map control to resize based on the browser window size WITHOUT causing a flicker on the postback. In theory the control should just make use of ajax fade the new image smoothly if the window size gets bigger or decrease the image size if the window size decreases.

I use map.resize on client side and this causes a postback. I understand this is necessary but it flickers and is slow.

Also on the same note, when one zooms in, or zooms out, or pans, or selects, an object on the map, the entire image flickers as it is redrawn. How does one manage this so that the map responds without flickering and instead just fades in and out smoothly? That way it would be more like AJAX.

Thank you for your assistance.

7/3/2012 1:46:43 PM
MVP
Total Posts 323

Re: Redraw on Postback without Flicker

If the Map control is used without map caching - each postbask will generate a new image which will be downloaded by the web browser and will be updated by the ASP.NET AJAX framework inside the UpdatePanel. AspMap has no control over this process.

Look at the 'Map Caching' topic in the documenation on how to implement an application where map images are cached by the web browser to provide an effect of smooth zooming / panning.

 

There is also the Map.ImageInterlace property which is enabled by default for PNG/GIF formats, it may look as  flickering, but its original purpose was to create an effect of progressive rendering for the waiting user.

7/3/2012 4:07:30 PM
Total Posts 11

Re: Redraw on Postback without Flicker

Thank you for the reply. However while the tile layer is an option, my layers are all spatial layers from DataTables and not static file based. And the tile layer does not allow adding DataTable as a layer source. How do I approach it given this scenario? I have tried the interlaced options and it does not appear to actually do that even though it is set as true.

Thank you for your assistance.

7/3/2012 6:03:01 PM
MVP
Total Posts 323

Re: Redraw on Postback without Flicker

We'll consider your request in next versions.

 

By now, it is possible to use a timeout to limit the number of resize() calls.

timeout = null;

function onMapResize()
{

   clear();

   timeout = window.setTimeout(doMapResize(), 500);

}

function doMapResize()
{

  clear();

  map.resize();

}

function clear()
{

   if (timeout)
   {

      window.clearTimeout(timeout);
      timeout=null;

   }

}

7/4/2012 9:34:53 AM
Total Posts 11

Re: Redraw on Postback without Flicker

Thank you for the reply. I have implemented the code but the flicker is still there.

I look forward to the feature being implemented. If we could have something similar to what you implemented for touch screens where the current image on the client literally zoomes in or out or pans then is replaced by the postback result, that would be great! Then when the postback result returns, it fades into focus as opposed to flickering. Thank you.