Exemple #1
0
 /// <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;
 }
Exemple #2
0
 /// <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;
 }
Exemple #3
0
        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));
        }
Exemple #5
0
 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");
     }
 }
Exemple #6
0
        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();
        }
        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();
        }
Exemple #9
0
        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))
 {
 }
Exemple #11
0
 public ConfigBing(BingMapType mapType)
 {
     _mapType = mapType;
 }
Exemple #12
0
 public ConfigBing(BingMapType mapType)
 {
     _mapType = mapType;
 }
Exemple #13
0
 public BingTileSource(String url, string token, BingMapType mapType)
     : this(new BingRequest(url, token, mapType))
 {
 }
Exemple #14
0
 public BingRequest(string baseUrl, string token, BingMapType mapType, string apiVersion = DefaultApiVersion)
 {
     throw new NotImplementedException();
 }
Exemple #15
0
 /// <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);
 }