UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

44 lines (43 loc) 1.36 kB
import { METERS_PER_UNIT as ol_METERS_PER_UNIT } from 'ol/proj'; class GeoConsts { } /** When circles needs to be rendered as polygon of N sides. */ Object.defineProperty(GeoConsts, "CIRCLE_TO_POLYGON_SIDES", { enumerable: true, configurable: true, writable: true, value: 64 }); Object.defineProperty(GeoConsts, "INCHES_PER_METER", { enumerable: true, configurable: true, writable: true, value: 39.37 }); // TODO REG : Is this correct ? // It seems that the this should be correct for WMS created from MapSever, // but not from GeoServer for example, which is generating tile at 90 dpi. // Is there an OGC standard output resolution ? // Should we read the DPI from the WMS-Server configuration ? Object.defineProperty(GeoConsts, "PRINT_DOTS_PER_INCH", { enumerable: true, configurable: true, writable: true, value: 72 }); // TODO REG : Is this correct ? // shouldn't we read this information from the current display? (desktop, mobile, ...) // https://www.infobyip.com/detectmonitordpi.php Object.defineProperty(GeoConsts, "SCREEN_DOTS_PER_INCH", { enumerable: true, configurable: true, writable: true, value: 96 }); Object.defineProperty(GeoConsts, "METERS_PER_UNIT", { enumerable: true, configurable: true, writable: true, value: ol_METERS_PER_UNIT }); export default GeoConsts;