I have custom imagery data being hosted on a local mapserver that covers a very small geographic region. I am using a custom MapTileSource to render the map and I am getting behavior that I don't understand due to my misunderstanding of a few items.
Under what circumstances should I be changing the values for WorldRect? Obviously my extent/bounds is not the entire world.
The "minimap" shows an image of the whole world, is there a way to make it zoom in so that my view box isn't so tiny?
The call to the MapTileSource constructor for the MapQuest example has 134217728? Where does this value come from, should I be changing it for my small geographic region?
How can I have it zoom in by default on my specific region and does this affect the URLs I generate in GetTileLayers? For example, I haven't a clue which Z,X,Y coordinates are needed to view my region from a world perspective.
Thanks,
Kris
Hi Kristopher,
Thank you for your post. I have been looking into your question and I can suggest you look into the following link from our online documentation which explains how to navigate/zoom the map content:
http://help.infragistics.com/Help/Doc/WPF/2014.1/CLR4.0/html/xamGeographicMap_Navigating_Map_Content_Using_Code.html
Let me know, if you need any further assistance on this matter.
That is very helpful in understanding several aspects. Thank you.
I'm still confused with respect to the constructor a custom MapTileSource. Why does the example pass in a value of 134217728 and how do I know if I need to change it? If I do need to change it, what value do I put there?
Hello Kristopher,
Thank you for your reply. I have been looking into your question and 134217728 is set value for the ImageHeight and ImageWidth properties of the MapTileSource. These two properties are used for setting the width and the height of the Deep Zoom image in this scenario. The last two values in the MapTileSource constructor are used for setting the TileHeight and TileWidth properties of the MapTileSource. They define the height and the width of the tiles in the Deep Zoom image.
For more information on this matter you could look into the into the following link from our online documentation:
http://help.infragistics.com/Help/Doc/WPF/2014.1/CLR4.0/html/InfragisticsWPF4.DataVisualization.v14.1~Infragistics.Controls.Maps.MapTileSource_members.html
I'm assuming its height and width in pixels? And I assume its the entire world?
Not quite sure how to figure out what the height and width are for the "deep zoom" image. I mean, its getting served up in tiles that are 256x256 or 512x512 (whichever I want).
What if my imagery is small, like a county or a city? Do I set it to that or still to what it would be for the entire world?
I see that all of the values are powers of 2. Does this affect my zoom level. Must the height and width always be powers of 2? My "deep zoom" images of smaller areas are definitely not powers of 2 when it comes to height and width.
Perhaps an assumption is being made about how maps work that I don't realize and therefore I am asking silly questions? Documentation found at the link could use better clarification.
Thank you for your reply. I have been looking into your question and the setting of the values of these properties depends on the resolution of your imaginary. The TileHeight and TileWidth properties presents the pixels(width and height of the tiles) used when zooming.
I assume that you need to set it regarding your imaginary in order to achieve the desired result. They should be symmetric e.g. 256x256.
If you need any further assistance on this matter, it would be great if you could attach a sample application that shows your issue in order to research it.
You're answer is somewhat informative, but doesn't give me the answer that I'm looking for. TileWidth and TileHeight are easy enough to figure and set and understand, lets focus on Deep Zoom image width and height. Things "appear" to be working with 134217728, but how do I know if/when I should change it? Part of the problem is that I have yet to discover a way of asking my map server or viewing a configuration that tells me what that "Deep" image width and height are. I'm hoping that by more fully understanding these two MapTileSource constructor parameters that I can either determine what the correct values should be based on other information or just leave it alone.
Here are the gridsets provided by my GeoServer installation:
EPSG:4326 | Tile Dimensions: 256x256 | Zoom Levels: 22EPSG:900913 | Tile Dimensions: 256x256 | Zoom Levels: 31
So lets do some math to try to understand this further.
134217728 = 2 ^ 27256 = 2 ^ 82^27 / 2^8 = 2^19 <-- Does this have a relationship to the zoom level or gridsets at all? Furthermore, how do you know that 134217728 is the correct value for the MapQuest data sample? How do you set the min and max zoom level for xamGeographicGrid? Is it related to this or am I chasing something unrelated?
Hopefully that helps to clarify my questions and confusion. I know the answer is going to be something simple -- it's always like in these situations.
Thank you for your reply. I contacted our development team about more information on this matter and they explained that the height/width of deep zoom image represents dimensions of the whole image at highest zoom level. This means that image width equals to sum of all tile images in one row, for example OpenStreetMap imagery has width of 134,217,728 because across the whole image, there are 524,288 (2^19) tiles of 256 pixels each so 134,217,728 = 256 x 2^19 (at max 19th zoom levels).
The attached image shows how tile images combine to create deep zoom image.
In your scenario you have tile images for a small geographic region so you could should still use 134,217,728 as dimensions of your custom tile source because the custom imagery should line up with geographic data that you might want to plot using geographic series.
Obviously, the map control should not show custom tiles that are outside of the small geographic region because they done exist in custom imagery source and GetTileLayers override should handle this by returning blank tiles.
To avoid displaying blank tiles in the map, you could use two options:
Limit map display region by setting WorldRect to geographic rectangle that contains all tiles in the small geographic region. Note that setting WorldRect property will also limit map panning to the value of geographic rectangle so tile outside of the small geographic region will not be visible in the map.
Use OpenSteetMap or other imagery type in map background content and add GeographicTileImagerySeries (see sample) bound to your custom imagery source such that your tiles will be overlaid over OpenSteetMap imagery.
It seems that option #1 will be better because you mentioned that you want to have bigger preview of their imagery in the map’s thumbnail (XamOverviewPlusDetailPane). You will need to provide screenshot (512x512) of their imagery source and use this image to override WorldStyle property of XamOverviewPlusDetailPane. The Map Overview Pane sample shows how to accomplish this.
The referred samples are for Silverlight but they could be find in the WPF Sample Browser, too.
Regarding you question about how to set the min and max zoom level for the map the answer is using a property called WindowRectMinWidth (defaults to 0.0001 but OSM support zooming up to 0.00001) on the geographic map.
Thank you for your reply. I am glad that the provided information is helpful.
Outstanding explanation. Thank you!