public static TileResource MakeGeoServerVector(CanonicalTileId id, string mapId, string gridset)
        {
            // GeoServer URL format: http://host:port/geoserver/gwc/service/tms/1.0.0/ {layer_name} @ {gridset_name} @pbf/ {z/x/y}.pbf
            if (Constants.GeoServerWebMercatorGridset.Equals(gridset))
            {
                // flip y-axis in case of WebMercator projection
                var y = (int)Math.Pow(2, id.Z) - id.Y - 1;
                id = new CanonicalTileId(id.Z, id.X, y);
            }

            var url = string.Format("{0}@{1}@pbf/{2}.pbf", MapUtils.MapIdToUrl(mapId, true), WWW.EscapeURL(gridset), id);

            return(new TileResource(url));
        }
예제 #2
0
 public static TileResource MakeVector(CanonicalTileId id, string mapId)
 {
     return(new TileResource(string.Format("{0}/{1}.vector.pbf", MapUtils.MapIdToUrl(mapId ?? "mapbox.mapbox-streets-v7"), id)));
 }
예제 #3
0
 public static TileResource MakeRawPngRaster(CanonicalTileId id, string mapId)
 {
     return(new TileResource(string.Format("{0}/{1}.pngraw", MapUtils.MapIdToUrl(mapId ?? "mapbox.terrain-rgb"), id)));
 }
예제 #4
0
 internal static TileResource MakeClassicRetinaRaster(CanonicalTileId id, string mapId)
 {
     return(new TileResource(string.Format("{0}/{1}@2x.png", MapUtils.MapIdToUrl(mapId ?? "mapbox.satellite"), id)));
 }
예제 #5
0
 internal static TileResource MakeRetinaRaster(CanonicalTileId id, string styleUrl)
 {
     return(new TileResource(string.Format("{0}/{1}@2x", MapUtils.NormalizeStaticStyleURL(styleUrl ?? "mapbox://styles/mapbox/satellite-v9"), id)));
 }
예제 #6
0
 internal static TileResource MakeStyleOptimizedVector(CanonicalTileId id, string mapId, string optimizedStyleId, string modifiedDate)
 {
     return(new TileResource(string.Format("{0}/{1}.vector.pbf?style={2}@{3}", MapUtils.MapIdToUrl(mapId ?? "mapbox.mapbox-streets-v7"), id, optimizedStyleId, modifiedDate)));
 }
 public static TileResource MakeVector(CanonicalTileId id, string mapId)
 {
     // Mapbox URL format: https://api.mapbox.com/v4/ {map_id} / {z/x/y} .vector.pbf
     return(new TileResource(string.Format("{0}/{1}.vector.pbf", MapUtils.MapIdToUrl(mapId ?? "mapbox.mapbox-streets-v7"), id)));
 }
예제 #8
0
 public static TileResource MakeClassicRaster(CanonicalTileId id, string tilesetId)
 {
     return(new TileResource(string.Format("{0}/{1}.png", MapUtils.TilesetIdToUrl(tilesetId ?? "mapbox.satellite"), id)));
 }