Tile Calculations

Bing
 

A set of methods that perform spatial calculations based on the Tile pyramid used by Bing Maps as defined here. These static methods are exposed through the Microsoft.Maps.SpatialMath.Tiles namespace.

NameReturn TypeDescription
mapSize(zoom: number)numberCalculates the full width of the map in pixels at a specific zoom level from -180 degrees to 180 degrees.
groundResolution(latitude: number, zoom: number, units?: DistanceUnits)numberCalculates the ground resolution at a specific degree of latitude in the specified units per pixel.
globalPixelToLocation(point: Point, zoom: number)LocationConverts a pixel coordinate into a geospatial coordinate at a specified zoom level. Global Pixel coordinates are relative to the top left corner of the map (90, -180).
locationToGlobalPixel(loc: Location, zoom: number)PointConverts a point from latitude/longitude WGS-84 coordinates (in degrees) into pixel XY coordinates at a specified level of detail.
globalPixelToTile(pixel: Point, zoom: number)PyramidTileIdCalculates the PyramidTileId that a global pixel intersects with at a specific zoom level.
tileToGlobalPixel(tile: PyramidTileId)PointConverts the upper-left corner of a PyramidTileId into a global pixel coordinate.
locationToTile(loc: Location, zoom: number)PyramidTileIdCalculates the PyramidTileId that a Location object intersects with at a specific zoom level.
getTilesInBounds(bounds: LocationRect, zoom: number)PyramidTileId[]Calculates all the PyramidTileId's that are within a LocationRect at a specific zoom level.
tileToLocationRect(tile: PyramidTileId)LocationRectCalculates the LocationRect of a PyramidTileId.
Show: