I have two questions about the Map Suite’s ability to use multiple maps at the same time.
1. Let’s assume we need to display a map of the coast. For this purpose, we have a S-57 nautical map (to display a sea area) and SHP map (to display a land area). My question is: How can I display two map of different formats on the same map control?
2. Let’s assume we have a multiple maps of the same area but each with different level of details. We need to display a map with the lowest level of details for the lowest zoom level, a map with the highest level of details for the highest zoom level, etc. My question is: How can I display a different map for each zoom level?
Best regards,
Bart
Using multiple maps
Hi Bart,
Thanks for your clearly description.
1. Your S-57 and SHP map should be area style. For render them as different style, I suggest you put them into two different shape file feature layers and set area style for each layer, you can add the sea area layer to overlay first, then add the land area layer. Please see our HowDoISample for detail code.
2. I am not sure how you separate your data source for different zoom level. Are there in same file but just with different column? Or they are separated in different files? If you have separated shape files for same area, that’s a simple problem. For example, data 1 for level 1 to level 10, data 2 for level 11 to level 20. You can put them into 2 layers, set area style for each layer, then set:
data1Layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level10;
data2Layer.ZoomLevelSet.ZoomLevel11.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
And add the two layers to overlay the same time, they will appear when suitable zoomlevel.
Wish that’s helpful.
Regards,
Don
Hi Don,
1. Can you point me to this specific HowDoISample?
2. I didn’t get full information on this subject from my clients yet. If data is separated in different files, your answer is very helpful. Thanks.
Regards,
Bart
Hi Bart,
For item 1, here is a simple sample for how to render your layers. Here I think your data with projection 4326, so mapUnit equal DecimalDegree, please modify it according your real situation.
ShapeFileFeatureLayer s57layer = new ShapeFileFeatureLayer("YourS57FilePath");
s57layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Water1;
s57layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
ShapeFileFeatureLayer shplayer = new ShapeFileFeatureLayer("YourSHPFilePath");
shplayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
shplayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay overlay = new LayerOverlay();
overlay.Layers.Add(s57layer);
overlay.Layers.Add(shplayer);
winformsMap1.Overlays.Add(overlay);
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-180, 90, 180, -90);
winformsMap1.Refresh();
In our HowDoISamples, there are many basic cases, they are helpful for understand our APIs.
Regards,
Don
What do you mean by "data with projection 4326" This is about coordinates?
Hi Bart,
Yes it’s about coordinates, sorry maybe I haven’t describe clearly.
Here is some more detail information about projection 4326, WGS 84: spatialreference.org/ref/epsg/4326/
I think you should know which projection your data is, that related with the MapUnit we set in our map control.
Regards,
Don