/// <remarks>You need a token for the the staging and the proper bing maps server, see: /// http://msdn.microsoft.com/en-us/library/cc980844.aspx</remarks> public BingRequest(string baseUrl, string token, BingMapType mapType, string apiVersion = DefaultApiVersion) { _urlFormatter = baseUrl + "/" + ToMapTypeChar(mapType) + QuadKeyTag + ".jpeg?g=" + ApiVersionTag + "&token=" + UserKeyTag; _userKey = token; ApiVersion = apiVersion; }
private static Map InitializeMapBing(BingMapType mt) { Map map = new Map(); TileLayer tileLayer = new TileLayer(new BingTileSource(BingRequest.UrlBingStaging, "", mt), "TileLayer - Bing " + mt); map.Layers.Add(tileLayer); map.ZoomToBox(tileLayer.Envelope); return(map); }
public ITileSource CreateTileSource() { var config = ConfigurationHelper.GetConfig(); var bingToken = config.AppSettings.Settings["BingToken"].Value; var bingUrl = config.AppSettings.Settings["BingUrl"].Value; const BingMapType mapType = BingMapType.Hybrid; return(new BingTileSource( bingUrl, bingToken, mapType)); }
private static char ToMapTypeChar(BingMapType mapType) { switch (mapType) { case BingMapType.Roads: return 'r'; case BingMapType.Aerial: return 'a'; case BingMapType.Hybrid: return 'h'; default: throw new ArgumentException("Unknown MapType"); } }
private static char ToMapTypeChar(BingMapType mapType) { switch (mapType) { case BingMapType.Roads: return('r'); case BingMapType.Aerial: return('a'); case BingMapType.Hybrid: return('h'); default: throw new ArgumentException("Unknown MapType"); } }
public BingLayerConfiguration(string fileCacheRoot, BingMapType bingMapType, string bingToken = null) : base(BruTileLayerPlugin.Settings.PermaCacheType, fileCacheRoot) { _bingMapType = bingMapType; _bingToken = bingToken; var url = string.IsNullOrEmpty(bingToken) ? BingRequest.UrlBingStaging : BingRequest.UrlBing; TileSource = new BingTileSource(url, bingToken, bingMapType); //TileSource.Schema.Resolutions.RemoveAt(0); //var s = TileSource.Schema as TileSchema; //s.Axis = AxisDirection.Normal; //s.OriginY = 0; //s.Extent = new Extent(s.Extent.MinX, 0, s.Extent.MaxX, s.Extent.MaxY); TileCache = CreateTileCache(); }
private static Map InitializeMapBing(BingMapType mt) { Map map = new Map(); TileLayer tileLayer = new TileLayer(new BingTileSource(BingRequest.UrlBingStaging, "", mt) , "TileLayer - Bing " + mt); map.Layers.Add(tileLayer); map.ZoomToBox(tileLayer.Envelope); return map; }
public BingTileSource(String url, string token, BingMapType mapType) : this(new BingRequest(url, token, mapType)) { }
public ConfigBing(BingMapType mapType) { _mapType = mapType; }
public BingRequest(string baseUrl, string token, BingMapType mapType, string apiVersion = DefaultApiVersion) { throw new NotImplementedException(); }
/// <remarks>You need a token for the the staging and the proper bing maps server, see: /// http://msdn.microsoft.com/en-us/library/cc980844.aspx</remarks> public BingRequest(string baseUrl, string token, BingMapType mapType) { _baseUrl = baseUrl; _token = token; _mapType = ToMapTypeChar(mapType); }