2gis/WinPhone-SDKs-for-tiles

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

WinPhone-SDKs-for-tiles

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!


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.