mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Maps] Always show current zoom level (#62684)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
b65de27458
commit
7882e0c3a8
1 changed files with 16 additions and 11 deletions
|
@ -5,28 +5,33 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import { EuiText } from '@elastic/eui';
|
||||
import { DECIMAL_DEGREES_PRECISION } from '../../../../common/constants';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
export function ViewControl({ mouseCoordinates, zoom }) {
|
||||
if (!mouseCoordinates) {
|
||||
return null;
|
||||
let latLon;
|
||||
if (mouseCoordinates) {
|
||||
latLon = (
|
||||
<Fragment>
|
||||
<strong>
|
||||
<FormattedMessage id="xpack.maps.viewControl.latLabel" defaultMessage="lat:" />
|
||||
</strong>{' '}
|
||||
{_.round(mouseCoordinates.lat, DECIMAL_DEGREES_PRECISION)},{' '}
|
||||
<strong>
|
||||
<FormattedMessage id="xpack.maps.viewControl.lonLabel" defaultMessage="lon:" />
|
||||
</strong>{' '}
|
||||
{_.round(mouseCoordinates.lon, DECIMAL_DEGREES_PRECISION)},{' '}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mapViewControl__coordinates">
|
||||
<EuiText size="xs">
|
||||
<small>
|
||||
<strong>
|
||||
<FormattedMessage id="xpack.maps.viewControl.latLabel" defaultMessage="lat:" />
|
||||
</strong>{' '}
|
||||
{_.round(mouseCoordinates.lat, DECIMAL_DEGREES_PRECISION)},{' '}
|
||||
<strong>
|
||||
<FormattedMessage id="xpack.maps.viewControl.lonLabel" defaultMessage="lon:" />
|
||||
</strong>{' '}
|
||||
{_.round(mouseCoordinates.lon, DECIMAL_DEGREES_PRECISION)},{' '}
|
||||
{latLon}
|
||||
<strong>
|
||||
<FormattedMessage id="xpack.maps.viewControl.zoomLabel" defaultMessage="zoom:" />
|
||||
</strong>{' '}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue