MapSuite Team,
My application provides user resizing. The wpfMap Control is contained within a Grid and the Grid within a User Control.
When the application resizes larger the map is not Refreshed, which is fine. However, when the application resizes smaller the map is Refreshed, which is not fine.
The application is not invoking a Refresh in either case.
Setting the MapResizeMode Property results in the following outcomes:
PreserveExtent – Refresh on smaller size, no Refresh on larger
PreserveScale – Refresh on smaller size, no Refresh on larger
PreserveScaleAndExtent – Refresh on smaller size, Refresh on larger
What is the reasoning behind a Refresh on a smaller wpfMap size? Is there any way to avoid this?
Regards,
Dennis
MapResizeMode and Refresh Activity
Hi Dennis,
We test the application building like yours, but seems all the cases will trigger the map refresh once the application size was changed. Besides, I guess I have some confusions on all of your cases, would you mind provide us a concrete sample to show all the issues?
Regards,
Johnny
Johnny,
The issue for me is the map refresh. My application resizes frequently and I do not want the map to refresh on a resize.
What I need to have happen is for no refresh to take place on resizing.
How can this be accomplished?
I am using V7.0.0.14.
Regards,
Dennis
Hi Dennis,
We have fixed this issue.
Please try getting this fix in 7.0.225.0 or later.
Regards,
Don
Don,
Thank you very much. I will get the latest MapSuite build. I probably should have done that first as the one I’m using is quite old.
Regards,
Dennis
Hi Dennis,
You’re welcome. Any question please let us know.
Regards,
Don
Don,
I am still encountering this issue even with the Production Build 7.0.234.0.
Any advice you might offer on this?
Regards,
Dennis
Hi Dennis,
I think Don doesn’t make the answer clear. What we did in the previous fix is just refresh the tiles when necessary. We used to refresh the map evertime the map resized; now, we only refresh the tiles when we enlarge the map size. I think this operation makes sense.
1. When we drag to make the map smaller, we only need to remove some of the existing tiles that out of current viewport extent. So we should remove those tiles from the logical tree to keep the map clean.
2. When we enlarge the map size, there must leave some blank spaces that we should fill with new tiles. If not, the blank space will always be blank unless we fill with new tiles. In this case, we need to refresh the overlay only to fill with the new tiles to form a complete map.
To verify this, we can hook up DrawingTile event on the LayerOverlay like this:
layerOverlay.DrawingTile += (s, a) =>
{
Console.WriteLine(
"Drawing tile."
);
};
Please watch the output panel, the tile drawing event won’t raise when the map size is smaller, but it will raise when the map size is larger. If this fix doesn’t satisfy your requirement, may you please provide us my following concerns?
1. If the map doesn’t refresh, do you want to fill new tiles with the blank area automatically? Or do you want to handle the operation before we do that, then call refresh manually?
2. If there is some special operation you did or effect I didn’t know, please try to provide us more detail.
3. If I misunderstand your requirement, please feel free to let me know.
Hope this makes sense and feel free to let us know if you have more queries.
Thanks,
Howard
Howard,
Thanks for the explanation, but not the way it is occurring for me. I added the DrawingTile Event as you suggested. The event is raised when the map is sized smaller. The event is not raised when the map is sized larger. This is the opposite of what you have stated.
When I size the map smaller it is not just tiles that are removed, in fact it is behaving as a RefreshAll would behave. The map is being completely redrawn.
When I size the map larger there is no redraw that occurs.
So my question is why does the map redraw itself when sized smaller?
I want the behavior when sized smaller to be the same as when sized larger, which is no map refresh/redraw.
In what I am seeing there is no difference between V7.0.14.0 and V7.0.234.0.
Regards,
Dennis
Dennis,
I exactly agree with you that the map won’t refresh when the size getting smaller. That was very weird behavior. Would you mind to send me a very simple project so that I can figure out the real reason? Just like some special settings on overlay.
Thanks,
Howard
Howard,
Based on your asking about Overlay Settings I decided to play around and vary the settings.
TileType set to HybridTile causes the map to refresh/redraw when the map is sized smaller.
TileType set to either SingleTile or MultipleTile results in no map refresh/redraw when the map is sized smaller.
I have had TileType set to HybridTile as that seems to give me the best performance.
What do you make of that?
Regards,
Dennis
Hi Dennis,
It behaviors different from my end. Please try my attached sample (I removed the dlls and the data to make the package smaller) and see the effect, just make sure we are standing in the same line.
Both MultipleTIle and HybridTile won’t hit the tile drawing event when the map size gets smaller. HybridTile is formed like multiple tile; but when panning, it behaviors like single tile which means when panning around, we won’t fill the new tiles until we finish panning. While multiple tile will keep filling new tiles during the panning. So multiple tile and hybrid tile should have the same effect. The single tile is formed by one tile. When the map size changed, the tile size will be changed as well. So we need to refresh the tile anytime when we resize the map.
So the MultiTile and HybridTile hit the event when the size getting larger, but do not hit this event when the size getting smaller. The SingleTile hits this event so long as the size is changed (when getting larger or smaller);
If you find some special settings, please let me know.
Thanks,
Howard
HitDrawingTileWhenResizeIssue.zip (9.57 KB)