MapUtils
Type module
Sources
Items from MapUtils can be imported/included and used via following ways.
/** * Import via: MapUtils.ts * Access items like: $maputils.myVariable */import * as $maputils from "@amcharts/amcharts5/MapUtils";Variables
MapUtils does not have any variables.
Functions
getGeoArea(geometry:GeoJSON.GeometryObject)Returns
numberReturns the area of a geometry on a sphere of radius 1, in steradians: the whole globe is 4π.
getGeoBounds(geometry:GeoJSON.GeometryObject)Returns { bottom:
number, left:number, right:number, top:number}Returns the geographic bounds of a geometry, in degrees: longitudes
leftandright, latitudestopandbottom. Bounds across the 180th meridian take all longitudes,-180to180.getGeoCentroid(geometry:GeoJSON.GeometryObject)Returns
IGeoPointReturns the geographic centroid of a geometry.
getGeoCircle(geoPoint:IGeoPoint,
radius:number)Returns
PolygonReturns a circle on the globe as GeoJSON geometry, for the
geometryof aMapPolygon.getGeoRectangle(north:number,
east:number,
south:number,
west:number)Returns
MultiPolygonReturns the area between two latitudes and two longitudes as GeoJSON geometry, for the
geometryof aMapPolygon. Its edges follow the parallels and meridians.getSunPosition(date:Date)Returns
IGeoPointSince 5.21.0Returns the point where the sun is directly overhead at a given time, such as for the
sunPositionof aMapRasterSeries. Accurate to a fraction of a degree.normalizeGeoPoint(geoPoint:IGeoPoint)Returns
IGeoPointBrings a point's longitude within
-180to180and its latitude within-90to90: a latitude past a pole comes back down on the other side.Changes
geoPointitself and returns it.