UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

42 lines (40 loc) 5.71 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _react = _interopRequireDefault(require("react")); var _utils = require("@kepler.gl/utils"); var _icons = require("../common/icons"); var _layerHoverInfo = require("./layer-hover-info"); // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project // 6th decimal is worth up to 0.11 m // https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude var DECIMAL = 6; var DECIMAL_Z = 1; var CoordinateInfoFactory = function CoordinateInfoFactory() { var CoordinateInfo = function CoordinateInfo(_ref) { var coordinate = _ref.coordinate, zoom = _ref.zoom; return /*#__PURE__*/_react["default"].createElement("div", { className: "coordingate-hover-info" }, /*#__PURE__*/_react["default"].createElement(_layerHoverInfo.StyledLayerName, { className: "map-popover__layer-name" }, /*#__PURE__*/_react["default"].createElement(_icons.CursorClick, { height: "12px" }), "Coordinate"), /*#__PURE__*/_react["default"].createElement("table", null, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", { className: "row" }, /*#__PURE__*/_react["default"].createElement("td", { className: "row__value" }, (0, _utils.preciseRound)(coordinate[1], DECIMAL), ","), /*#__PURE__*/_react["default"].createElement("td", { className: "row__value" }, (0, _utils.preciseRound)(coordinate[0], DECIMAL), ","), /*#__PURE__*/_react["default"].createElement("td", { className: "row__value" }, (0, _utils.preciseRound)(zoom, DECIMAL_Z), "z"))))); }; return CoordinateInfo; }; var _default = exports["default"] = CoordinateInfoFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl91dGlscyIsIl9pY29ucyIsIl9sYXllckhvdmVySW5mbyIsIkRFQ0l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