ThinkGeo.com    |     Documentation    |     Premium Support

V12.1 - Zoom In/Out Results in Flash

ThinkGeo Team,

I’ve noticed that when either a ZoomIn or ZoomOut is performed a one-time flash of the map appears.

For example, on a ZoomOut the existing imaged is reduced, the reduced image is cleared, and then the new rendering takes place. The fact that the reduced image is cleared is what causes the ‘flash’.

This ‘flash’ does not appear under V10.6. Under V10.6 the first thing that happens is the existing image is reduced and then the new rendering takes place.

It would be nice to see this behave in the same fashion as V10.6.

Regards,
Dennis

Thanks Dennis,
We noticed this issue before. We recommend use Map.BackgroundOverlay to set the background of the map. This will make the zoom in/out process more smooth.

Demo.zip (1.5 MB)

Thanks

Frank

Frank,

How is the below line of code a solution?

map.BackgroundOverlay.BackgroundBrush = GeoBrushes.AliceBlue

I added this line to my application and now the map background is always AliceBlue and the map still ‘flashes’ during a zoom.

This should behave the same way as V10.6.

Dennis

Thanks Dennis,
As talked with the development team. This because the reduced image is cleared earlier than it should be. We need clear the old image after all the new requested image take over the spot. We are looking into more detail.

Thanks

Frank

Hi Dennis,
We did some improvements in latest 13.0-beta version, would like to let you know and give a try if that fix your issue.
If you still having issues please feel free to let us know. It will be great if you can provide a simple sample to reproduce the issue that we can test against to verify.
Thanks,
Jack

hi Jack,

I’ve been working this issue for at least a week now and have narrowed it down to multiple LayerOverlay’s, but still not exactly sure what is going on.

The application makes use of multiple LayerOverlay’s. There is one LayerOverlay each for Feature Layers, Raster Layer, and WMS Layer. The are roughly 10 InMemoryFeatureLayer s each with their own corresponding LayerOverlay.

ZoomIn/ZoomOut will ‘flash’ when the application is configured with InMemoryFeatureLayer s that have their own corresponding LayerOverlay.

If the application is configured such that the InMemoryFeatureLayer s use the LayerOverlay for Feature Layers, as stated above, then there is no ‘flash’.

So it would appear that this ‘flash’ has something to do with multiple LayerOverlay’s.

I will be doing more investigation in order to narrow this down and will let you know what I find.

By the way, after your changes the ZoomIn/ZoomOut, in terms of response time, is much better than before your changes, and certainly much much improved over MapSuite. The biggest complaint from my users is ZoomIn/ZoomOut response time under MapSuite. The CenterAt and ZoomTo methods also have much improved response times.

Regards,
Dennis

Hi Dennis,

Good to hear our recent enhance improves in your application, we are always keep working on the improvements.
Regarding the “Flash” issue, seems like it only happens in certain scenario and sounds like it was due to the stretched image gets cleared earlier than expected, I would like to propose give a try the following code, see if it does the trick.
Basically, the following code postpone the stretched image clear process. It stays behind the map until next zoom in/out occur to get it cleared.

private void MapView_Loaded(object sender, RoutedEventArgs e)
{
// …
mapView.StretchedTileClearing += MapView_StretchedTileClearing;
}

private void MapView_StretchedTileClearing(object sender, StretchedTileClearingMapViewEventArgs e)
{
e.Cancel = true;
}
Thanks,
Jack

hi Jack,

Added your code and the flash no longer occurs. However, after a ZoomOut, followed by a ZoomIn that interim image is still being displayed. Below are screen-captures that show this.

Doing a ZoomOut shows the interim tile as well.

Thanks,
Dennis

Initial rendering of extent:

ZoomOut occurs without flash:

ZoomIn leaves interim tile:

hi Jack,

What’s your assessment of this issue? Do you feel it is a ThinkGeo issue or my issue?

Thanks,
Dennis

Dennis,
Sorry for the late response. Forgot to mention, in order to use this tick to work around the flash issue, need to add an extra overlay as background at the bottom of the map
example:

    public static  void LoadMap(MapView mapView) {
        mapView.MapUnit = GeographyUnit.Meter;
        // Add an overlay with backgroundLayer.
        LayerOverlay backgroundOverlay = new LayerOverlay();
        backgroundOverlay.Layers.Add(new BackgroundLayer(new GeoSolidBrush(GeoColors.Gray)));
        mapView.Overlays.Insert(0,backgroundOverlay);
        
        //  load your own overlays

        mapView.StretchedTileClearing += MapView_StretchedTileClearing;
        mapView.Refresh();
    }

Please give a try and let us know how it goes.
Thanks,
Jack

Jack,

I added your code using Marron as the background color so that it would be apparent that the overlay/layer was actually loaded.

This results in exactly the same original behavior with the flash. So the stretched-tile is no longer left visible, but the flash is back.

Dennis

Hi Dennis,
We can’t reproduce the flash issue using code above, would you put together a sample to reproduce the issue that we can look into more on it?
Thanks,
Jack

hi Jack,

I’ve been working with two other of my applications where I have been able to reproduce the ‘flash’ upon Zoom.

The first application is used to list in DataGrid’s Shape, SQLite, and GeoDatabase feature layers and by user selection view selected layers within the map. It is much simpler than my full-blown user production application. Originally, this application did not exhibit the ‘flash’. From working on my user application I learned that this ‘flash’ is caused when an application has multiple LayerOverlay’s. So what I did to my viewer application is simply add a second LayerOverlay, and presto, the ‘flash’ exhibits itself.

The second application is incredibly simple. So I proceeded to add a second LayerOverlay to it, but, alas, there was no ‘flash’ that exhibited itself. This application was pretty old and only used NuGet package “ThinkGeo.UI.Wpf” Version=“13.0.0-beta048”. So I decided to simply upgrade it to use “ThinkGeo.UI.Wpf” Version=“13.0.0-beta224”, and, presto, the ‘flash’ now exhibits itself.

All three of these applications are .NET Core. Two are V3.1 and the simple one is V3.0.

I am now totally convinced that this is not caused by any of my applications.

I will work on providing the incredibly simple application for you and will email you a DropBox link.

Another interesting tidbit is in my full-blown user application I added some code that sets each of the secondary LayerOverlay property IsVisible to False. Once set to False the ‘flash’ no longer exhibits itself.

Another interesting tidbit is that the ‘flash’ exhibits itself after the OverlaysDrawn event has occurred, which is the last code invoked in my user application…

I’ve also removed all of your suggested Stretched related code.

Regards,
Dennis

hi Jack,

I emailed support@thinkgeo.com with a DropBox link to the application.

Regards,
Dennis

Thanks Dennis,
We will look into this and keep you updated.

-Thanks,
Jack

Hi Dennis,
We have fixed the flash issue in ThinkGeo.UI.Wpf 13.0.0-beta241, package should be out in NuGet tomorrow. Please give a try and feel free to let us know how it goes.
Thanks,
Jack

hi Jack,

Thanks much, I’ll download the NuGet’s when available and let you know the results.

Dennis

hi Jack,

I’ve updated the demo application, that I previously provided, with the latest packages. I’ve also updated my full production application.

Unfortunately, the flash still occurs.

I’ve sent an email to support@thinkgeo.com with a DropBox shared folder with example videos and explanations.

Dennis

Hi Dennis,
Regarding the video: OriStarFlashDemoForThinkGeo.mp4

  1. The flash has been reduced, but still occurs.

  2. The flash still ocurring in the OriStarFlashDemoForThinkGeo demo program.

  3. The flash occurs from ZoomLevel13 to ZoomLevel17.

The “flash” you mentioned occurs at zoom level 13 to 17 was caused by the fill color transparency not the flash bug. In the application, using TheAreaStyle.FillBrush= new GeoSolidBrush(GeoColors.Grass); to fill the polygon, the color GeoColors.Grass is a half transparency color, ARGB value equivalent to

A(transparency) 150,

R(red)216

G(Green)221,

B(Blue)188.

When zoom in/out, there is a moment new tile(s) been drawn, but old stretch image haven’t been cleared (it will be cleared when all tiles been drawn), that new tiles drawn on top of old stretch image, which means 2 layers of Transparency 150 color stack over, make it solid non-transparency color. But this only last for a moment, goes away very quick when stretch image gets cleared (when all tiles been drawn), that color change looks like the map is flashing.

Solution is: change the Fill color from GeoColors.Grass(ARGB: 150, 216, 221, 188 ) to GeoColor.FromArgb(255, 216, 221, 188)

Regarding the full production application, are you good with the work around of moving all layers into the same LayerOverlay?
Thanks,
Jack

hi Jack,

Changing

TheAreaStyle.FillBrush = new GeoSolidBrush(GeoColors.Grass);
to
TheAreaStyle.FillBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 216, 221, 188));

Did indeed provide for smooth zooming.

Where does this leave us in terms of being able to use named GeoColors? Will we see the ARGB value of Grass changed to (255, 216, 221, 188)?

Is this true for all named colors?

As far as the production application a single LayerOverlay is not going to work. I have several raster layers that have their own LayerOverlay. I also have several AVL/GPS InMemoryFeatureLayer’s that each have their own LayerOverlay. Now that I’m mentioning raster layers I see too now that they also are flashing.

Dennis