2
votes

Is there any way to change the infinite scrolling functionality for a Windows.UI.Xaml.Controls.Maps.MapControl? I am trying to use it to display some local tiles (some sort of blue print) and when I scroll horizontally through it I want it to stop when it reaches the end.

Thanks.

1
May I ask why are you using the map control to do this and not a scrollviewer..? For what I have got from the question you want to display a blueprint with large dimensions in your application..please clarify your requirement.. - Pratyay
The blueprint should have the map functionality (zoom and scroll) and the tiles for it should be loaded accordingly. The structure for the assets is the one the maps uses with zoomLevel folders and tiles: Assets/{zoom_level}/{x}_{y}. - Titus Moldovan
In case anybody else faces this problem, after a lot of digging I came to the conclusion that MapControl still has many problems (beside this wrap-around property, not being able to load non-quadratic tiles would be another one). Please let me know if you find out something else. xamlmapcontrol.codeplex.com this is a really great open-source library that can be used instead. - Titus Moldovan

1 Answers

0
votes

You cannot stop UWP Map control to for asking tiles in case of any kind of tile's implementation like thit one HttpMapTileDataSource

What you can do is try to cancel tile's query in the method below by using predefined coordinates in your client app or if you have implemented your own tile's server do checks over there and return empty transparent png file 1 x 1 pixels.

private void DataSource_UriRequested(HttpMapTileDataSource s, MapTileUriRequestedEventArgs e)
        {
            var deferral = e.Request.GetDeferral();

            // var qk = TileSystem.TileXYToQuadKey(e.X, e.Y, e.ZoomLevel);

            e.Request.Uri = new Uri($"{url}x={e.X}&y={e.Y}&z={e.ZoomLevel}"); 

            deferral.Complete();
        }