Name: WinPhone-SDKs-for-tiles
Owner: 2GIS
Description: null
Created: 2017-08-25 09:04:16.0
Updated: 2017-08-28 11:30:57.0
Pushed: 2017-08-28 11:32:38.0
Homepage: null
Size: 22
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is demo project to show how integrate 2GIS Tiles in Universal Windows Apllication
First, add Bing MapControl to page:
e xmlns:Maps="using:Windows.UI.Xaml.Controls.Maps" ...>
<Maps:MapControl HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
x:Name="Map">
</Maps:MapControl>
ge>
Then you must register with Bing Maps and get map key, otherwise you will see red text “No MapServiseToken” over tiles. How to register and request key
Final step: override tile source for map control:
HttpMapTileDataSource dataSource = new HttpMapTileDataSource("http://tile2.maps.2gis.ru/tiles?x={x}&y={y}&z={zoomlevel}&v=1");
MapTileSource tileSource = new MapTileSource(dataSource)
{
Layer = MapTileLayer.BackgroundReplacement,
IsFadingEnabled = false,
};
Map.Style = MapStyle.None;
Map.TileSources.Add(tileSource);
It's all! Build, run and enjoy!