I am testing a mapManager class which can read map layer shape files from a xml configuration file and display the layers correctly in a WGS84 map. Everything goes well except that when the final layer shape file is processed, the map loader application cannot respond to any Map GUI action, such as zoom in/out and seems getting stuck at the display for ever. I call the loadMapFromXml method in Wpf_MapLoaded. What could be the problem? Thanks.
Thanks for your sample code, I review line by line but I didn’t find any code may cause the problem. Could you provide your xml file as well so that I can reproduce your problem at my machine?
I think you add staticOverlay too many times, you can try to move “wpfMap1.Overlays.Add(staticOverlay);” outside the while loop because you only need to add it once. And also you set CurrentExtent every time and refresh wpfMap every time for each layer, I don’t know what your intention but you can move them out of the while loop and just call them once after loading all layers.
Logically you are correct. I tried this outside the while loop several times already but nothing would be shown in the map area. So I was forced to the present approach, because at least it shows all the layers. Do you know why this weird thing happen?
I think your code might be wrong, could you provide the code which you put all metioned staff out of the while loop? And I can review again to check if I can find the problem.
That's weird I don't know what your problem. Could you do the following test to verify if the problem is caused by MapSuite or not?
Don't use xml file, just write code like our HowDoI samples, create 16 ShapeFileFeatureLayer and set the specific styles and apply to zoom level 20, add all layers to static overlay, and then add static overlay to wpfMap, set MapUnit, CurrentExtent, call Refresh(), such as following code. If it works that means it's not the MapSuite's issue, If it still has problem, please provide the code and we can figure out how to fix it.
I had no problem in displaying multiple layer map following the conventional way. But it is very inconvenient if you have to do it in the hard coded way for deploying a map application, which is supposed to be run on any set of map shape files defined in the xml configuration file. I am solving the xml maploader problem, nothing else. Thanks.
Thanks for your reply, you may misunderstand my point, I just want to make sure if the problem is caused by MapSuite or not, that way is just a test, not really suggest you do like that. So now I know the problem is caused by your xml parsing, you can add some trace to output the settings of each layer, and compare the hard coded setting, and then you will find which part is different.