This project has moved. For the latest updates, please go here.

Loading data from an external source

Jun 15, 2016 at 5:59 PM
Edited Jun 15, 2016 at 5:59 PM
I'm trying to load the data of this map:
http://viewers-guide.hbo.com/game-of-thrones/season-6/episode-8/map
I've managed to figure out that all the tiles are at http://viewers-guide.hbo.com/mapimages/6/y1x1.png with the following
format: http://viewers-guide.hbo.com/mapimages/{zoom_between_6_and_8}/y{y}x{x}.png
I've also found out that the maximum south east tiles for each scale are:
-6/y5x7.png
-7/y13x21.png
-8/y25x39.png

but the last row and last column aren't the same size as the others (16 wide / 115 high for 8, 124 wide / normal height (256) for 7, and 208 wide / 23 high for 6.

How can I get all of this to work correctly?
Coordinator
Jun 16, 2016 at 9:26 AM
Edited Jun 16, 2016 at 9:28 AM
Sorry, that won't work. I've tried a TileLayer like this:
<map:TileLayer x:Key="GOT" SourceName="GOT"
   TileSource="http://viewers-guide.hbo.com/mapimages/{z}/y{y}x{x}.png"
   MinZoomLevel="6" MaxZoomLevel="8"/>
Although a set of consecutive tile images appears at zoom levels 6, 7, and 8, they don't seem to use the "Web Mercator" map projection, so that the map is shown in the wrong location. That wouldn't be totally bad if there was only one layer, but results in misalignment of the three layers during zoom.

You may search the web for "openstreetmap tiling scheme" or "bing maps tiling scheme" for detailed information how the indices work in a tile URL.
Jun 16, 2016 at 9:52 AM
Thanks for your quick answer. What I guess I will do is create my own custom tiles from that map, using the correct tiling scheme. Is it possible to load tiles from a local source? What would happen if I was to give a "ms-appx:///" TileSource?
Coordinator
Jun 16, 2016 at 10:15 AM
It should work with an ImageTileSource like
<map:ImageTileSource UriFormat="ms-appx:///Assets/{z}/{x}/{y}.png"/>
Just out of curiosity, is this related to this question on StackOverflow?
Jun 16, 2016 at 11:22 AM
Yup, that's me. Then I found out this MapControl, and it's actually a lot more suited to my needs than the official UWP MapControl.
Coordinator
Jun 16, 2016 at 11:47 AM
Thanks for your feedback. I was thinking about answering that question. Now I can skip it ;-)