MCPcopy Create free account
hub / github.com/Maps4HTML/MapML.js / _hasProjectedCoordinates

Function _hasProjectedCoordinates

src/mapml/handlers/QueryHandler.js:16–20  ·  view source on GitHub ↗
(json)

Source from the content-addressed store, hash-verified

14// values exceed CRS:84 bounds (lon [-180,180], lat [-90,90]), indicating
15// meter-based projected units (e.g. from WMS GetFeatureInfo responses).
16function _hasProjectedCoordinates(json) {
17 if (json.crs != null) return true;
18 let c = _firstCoordinate(json);
19 return c !== null && (Math.abs(c[0]) > 180 || Math.abs(c[1]) > 90);
20}
21
22// Extract the first [x, y] coordinate pair from a GeoJSON object,
23// drilling into FeatureCollection → Feature → Geometry → coordinates.

Callers 1

fetchFeaturesFunction · 0.85

Calls 1

_firstCoordinateFunction · 0.85

Tested by

no test coverage detected