Skip to content

WebApiExtentHelper

Namespace: ThinkGeo.UI.WebApi

Provides helpers for computing map extents and bounding boxes for XYZ tiles.

public static class WebApiExtentHelper

Inheritance ObjectWebApiExtentHelper

Methods

GetBoundingBoxForXyz(Int64, Int64, Int32, GeographyUnit)

Calculates the world-space extent covered by an XYZ tile using 256-pixel tiles and the default zoom-level definitions for the specified map unit.

public static RectangleShape GetBoundingBoxForXyz(long x, long y, int z, GeographyUnit mapUnit)

Parameters

x Int64
Tile column index, where 0 is the leftmost column at the given zoom level.

y Int64
Tile row index, where 0 is the top row at the given zoom level.

z Int32
Zoom level index in the XYZ tiling scheme.

mapUnit GeographyUnit
Map unit used by the target map.

Returns

RectangleShape
that describes the tile bounds in world coordinates.

GetBoundingBoxForXyz(Int64, Int64, Int32, GeographyUnit, TileMatrix)

Calculates the world-space extent covered by an XYZ tile using the default 256-pixel tile size and the supplied tile matrix.

public static RectangleShape GetBoundingBoxForXyz(long x, long y, int z, GeographyUnit mapUnit, TileMatrix tileMatrix)

Parameters

x Int64
Tile column index, where 0 is the leftmost column at the given zoom level.

y Int64
Tile row index, where 0 is the top row at the given zoom level.

z Int32
Zoom level index in the XYZ tiling scheme.

mapUnit GeographyUnit
Map unit used by the target map.

tileMatrix TileMatrix
Tile matrix that defines the tiling scheme; pass null to fall back to the default matrix.

Returns

RectangleShape
that describes the tile bounds in world coordinates.

GetBoundingBoxForXyz(Int64, Int64, Int32, GeographyUnit, ZoomLevelSet)

Calculates the world-space extent covered by an XYZ tile using the provided zoom-level set and default tile size.

public static RectangleShape GetBoundingBoxForXyz(long x, long y, int z, GeographyUnit mapUnit, ZoomLevelSet zoomLevelSet)

Parameters

x Int64
Tile column index, where 0 is the leftmost column at the given zoom level.

y Int64
Tile row index, where 0 is the top row at the given zoom level.

z Int32
Zoom level index in the XYZ tiling scheme.

mapUnit GeographyUnit
Map unit used by the target map.

zoomLevelSet ZoomLevelSet
Zoom level definitions that drive the scale calculation.

Returns

RectangleShape
that describes the tile bounds in world coordinates.

GetBoundingBoxForXyz(Int64, Int64, Int32, GeographyUnit, ZoomLevelSet, TileMatrix)

Calculates the world-space extent covered by an XYZ tile using the provided zoom-level set and tile matrix.

public static RectangleShape GetBoundingBoxForXyz(long x, long y, int z, GeographyUnit mapUnit, ZoomLevelSet zoomLevelSet, TileMatrix tileMatrix)

Parameters

x Int64
Tile column index, where 0 is the leftmost column at the given zoom level.

y Int64
Tile row index, where 0 is the top row at the given zoom level.

z Int32
Zoom level index in the XYZ tiling scheme.

mapUnit GeographyUnit
Map unit used by the target map.

zoomLevelSet ZoomLevelSet
Zoom level definitions that drive the scale calculation.

tileMatrix TileMatrix
Tile matrix that defines the tiling scheme; pass null to fall back to the default matrix.

Returns

RectangleShape
that describes the tile bounds in world coordinates.

GetBoundingBoxForXyz(Int64, Int64, Int32, Int32, Int32, GeographyUnit, ZoomLevelSet, TileMatrix)

Calculates the world-space extent covered by an XYZ tile using explicit tile dimensions and optional tiling metadata.

public static RectangleShape GetBoundingBoxForXyz(long x, long y, int z, int tileWidth, int tileHeight, GeographyUnit mapUnit, ZoomLevelSet zoomLevelSet, TileMatrix tileMatrix)

Parameters

x Int64
Tile column index, where 0 is the leftmost column at the given zoom level.

y Int64
Tile row index, where 0 is the top row at the given zoom level.

z Int32
Zoom level index in the XYZ tiling scheme.

tileWidth Int32
Tile width, in pixels.

tileHeight Int32
Tile height, in pixels.

mapUnit GeographyUnit
Map unit used by the target map.

zoomLevelSet ZoomLevelSet
Optional zoom level definitions used to derive the tile scale.

tileMatrix TileMatrix
Optional tile matrix that defines the tiling scheme.

Returns

RectangleShape
that describes the tile bounds in world coordinates.

GetSnappedScale(RectangleShape, Double, GeographyUnit)

internal static double GetSnappedScale(RectangleShape worldExtent, double screenWidth, GeographyUnit worldExtentUnit)

Parameters

worldExtent RectangleShape

screenWidth Double

worldExtentUnit GeographyUnit

Returns

Double

GetSnappedZoomLevelIndex(Double, GeographyUnit)

internal static int GetSnappedZoomLevelIndex(double scale, GeographyUnit geographyUnit)

Parameters

scale Double

geographyUnit GeographyUnit

Returns

Int32