public MainPage() { this.InitializeComponent(); this.NavigationCacheMode = NavigationCacheMode.Required; _map = new MapControl(); _map.MapServiceToken = "yourtoken"; BasicGeoposition center = new BasicGeoposition(); center.Latitude = 50.07574; center.Longitude = 14.416; _map.Center = new Geopoint(center); _map.ZoomLevel = 17; HttpMapTileDataSource dataSource = new HttpMapTileDataSource(); dataSource.UriRequested += new TypedEventHandler <HttpMapTileDataSource, MapTileUriRequestedEventArgs>( (source, args) => { Rect mercBounds = GlobalMercator.TileBounds(new Tile(args.X, args.Y), args.ZoomLevel); args.Request.Uri = new Uri(string.Format(_wmsUrl, mercBounds.Left, Math.Abs(mercBounds.Bottom), mercBounds.Right, Math.Abs(mercBounds.Top)));; }); _map.TileSources.Add(new MapTileSource(dataSource)); this.Content = _map; }
public void TestGlobalMercatorSchema() { string message; var s1 = new GlobalMercator("png", 2, 11); var s2 = SandD(s1); var equal = EqualTileSchemas(s1, s2, out message); Assert.IsTrue(equal, message); }
public MainPage() { this.InitializeComponent(); this.Loaded += delegate { _bingMap = new Bing.Maps.Map(); _bingMap.Center = new Location(50.07574, 14.416); _bingMap.ZoomLevel = 17; MapTileLayer mapTileLayer = new MapTileLayer(); mapTileLayer.GetTileUri += delegate(object sender, GetTileUriEventArgs e) { Rect mercBounds = GlobalMercator.TileBounds(new Tile(e.X, e.Y), e.LevelOfDetail); e.Uri = new Uri(string.Format(_wmsUrl, mercBounds.Left, Math.Abs(mercBounds.Bottom), mercBounds.Right, Math.Abs(mercBounds.Top))); }; _bingMap.TileLayers.Add(mapTileLayer); this.Content = _bingMap; }; }
public void Init() { _globalMercator = new GlobalMercator(); _latitudeLongitudePoint = new PointD(143.068055770704, -38.4537515036619); _mercatorPoint = new PointD(15926263.117, -4643725.484); }