예제 #1
0
        public void GetTile(MapTileKey key, Action <IMapTile> success, Action <Exception> error)
        {
            var parameters = GetParameters();

            var url = string.Format(UrlTemplate,
                                    parameters.Key,
                                    parameters.ColorStyle,
                                    key.LevelOfDetail,
                                    key.Col,
                                    key.Row);

            WebRequestHelper.DownloadDataAsync(url, parameters.Timeout, stream => success(new MapTile(key, stream)), error);
        }
예제 #2
0
        public void GetTile(MapTileKey key, Action <IMapTile> success, Action <Exception> error)
        {
            var p          = key.ToWorldPos();
            var parameters = GetParameters();
            var url        = string.Format(CultureInfo.InvariantCulture.NumberFormat, UrlTemplate,
                                           parameters.Key,
                                           p.Y,
                                           p.X,
                                           key.LevelOfDetail,
                                           parameters.MapType.ToString().ToLower());

            if (!string.IsNullOrEmpty(parameters.Language))
            {
                url += "&language=" + parameters.Language;
            }
            WebRequestHelper.DownloadDataAsync(url, parameters.Timeout, stream => success(new MapTile(key, stream)), error);
        }