Azure Maps uses MapLibre (forked version of Mapbox) under the hood for rendering. With this in mind, there are a few different ways to get a line to cross the antemeridian:
- You can use longitude values outside the -180/180 range. So if you have a line with two points with longitude values 170 and 210, it should cross the antemeridian when rendered.
- The
atlas.mathnamespace provides a couple of methods for modifying the geometry so that it crosses the antemeridian.
| Function name | Returns | Description |
|---|---|---|
getPathDenormalizedAtAntimerian(LineString | Position[]) |
Position[] |
Denormalizes path on antimeridian, this makes lines with coordinates on the opposite side of the antimeridian to always cross it. Note that the path crossing antimeridian will contain longitude outside of -180 to 180 range. See getPathSplitByAntimeridian when this is not desired. |
getPathSplitByAntimeridian(LineString | Position[]) |
Position[][] |
Split path on antimeridian into multiple paths. See getPathDenormalizedAtAntimerian when this is not desired. |
getGeodesicPaths(LineString | Position[], number) |
Position[][] |
Takes an array of positions objects and fills in the space between them with accurately positioned positions to form an approximated Geodesic path broken by antimeridian into multiple sub-paths. |
getRegularPolygonPaths(Position | Point, number, number, string | DistanceUnits, number) |
Position[][] |
Calculates an array of position objects that are an equal distance away from a central point to create a regular polygon broken by antimeridian into multiple sub-paths. |