Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 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");
     }
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 10
0
 public BingTileSource(String url, string token, BingMapType mapType)
     : this(new BingRequest(url, token, mapType))
 {
 }
Ejemplo n.º 11
0
 public ConfigBing(BingMapType mapType)
 {
     _mapType = mapType;
 }
Ejemplo n.º 12
0
 public ConfigBing(BingMapType mapType)
 {
     _mapType = mapType;
 }
Ejemplo n.º 13
0
 public BingTileSource(String url, string token, BingMapType mapType)
     : this(new BingRequest(url, token, mapType))
 {
 }
Ejemplo n.º 14
0
 public BingRequest(string baseUrl, string token, BingMapType mapType, string apiVersion = DefaultApiVersion)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 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);
 }