//public DataSourceCustomOnlineMaps(string name)
        //    : this(name, false)<param name="isForConvert">indicate this datasource is for format convert purpose, not for PBS service purpose. when this is true, gettile() method will return null instead of returning an error image byte[]</param>
        //{

        //}

        protected override void Initialize(string path)
        {
            this.Type = _mapName;
            base.Initialize(path);

            CustomOnlineMap map = CustomOnlineMaps.Where(m => m.Name == _mapName).ToList()[0];

            _baseUrl    = map.Url.Replace("{$s}", "{0}").Replace("{$x}", "{2}").Replace("{$y}", "{3}").Replace("{$z}", "{1}");
            _subDomains = map.Servers;
            //for bing maps imagery, add bing key if has one
            if (_mapName.ToLower().Contains("bing") && _mapName.ToLower().Contains("image") && !string.IsNullOrEmpty(ConfigManager.App_BingMapsAppKey))
            {
                _baseUrl += "&token=" + ConfigManager.App_BingMapsAppKey;
            }
        }
Example #2
0
        protected override void Initialize(string path)
        {
            this.Type = _mapName;
            this.Path = path;
            TilingScheme ts;

            try
            {
                ReadTilingScheme(out ts);
            }
            catch (Exception e)
            {
                throw new Exception("Reading tiling shceme failed!\r\n" + e.Message + "\r\n" + e.StackTrace);
            }
            TilingScheme = ts;
            IsOnlineMap  = IsOnlineMaps(Type);

            CustomOnlineMap map = CustomOnlineMaps.Where(m => m.Name == _mapName).ToList()[0];

            _baseUrl    = map.Url.Replace("{$s}", "{0}").Replace("{$x}", "{2}").Replace("{$y}", "{3}").Replace("{$z}", "{1}").Replace("{$v}", "{4}");
            _subDomains = map.Servers;
        }