File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
x-pack/legacy/plugins/maps/public/connected_components/widget_overlay/view_control Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change 55 */
66
77import _ from 'lodash' ;
8- import React from 'react' ;
8+ import React , { Fragment } from 'react' ;
99import { EuiText } from '@elastic/eui' ;
1010import { DECIMAL_DEGREES_PRECISION } from '../../../../common/constants' ;
1111import { FormattedMessage } from '@kbn/i18n/react' ;
1212
1313export function ViewControl ( { mouseCoordinates, zoom } ) {
14- if ( ! mouseCoordinates ) {
15- return null ;
14+ let latLon ;
15+ if ( mouseCoordinates ) {
16+ latLon = (
17+ < Fragment >
18+ < strong >
19+ < FormattedMessage id = "xpack.maps.viewControl.latLabel" defaultMessage = "lat:" />
20+ </ strong > { ' ' }
21+ { _ . round ( mouseCoordinates . lat , DECIMAL_DEGREES_PRECISION ) } ,{ ' ' }
22+ < strong >
23+ < FormattedMessage id = "xpack.maps.viewControl.lonLabel" defaultMessage = "lon:" />
24+ </ strong > { ' ' }
25+ { _ . round ( mouseCoordinates . lon , DECIMAL_DEGREES_PRECISION ) } ,{ ' ' }
26+ </ Fragment >
27+ ) ;
1628 }
1729
1830 return (
1931 < div className = "mapViewControl__coordinates" >
2032 < EuiText size = "xs" >
2133 < small >
22- < strong >
23- < FormattedMessage id = "xpack.maps.viewControl.latLabel" defaultMessage = "lat:" />
24- </ strong > { ' ' }
25- { _ . round ( mouseCoordinates . lat , DECIMAL_DEGREES_PRECISION ) } ,{ ' ' }
26- < strong >
27- < FormattedMessage id = "xpack.maps.viewControl.lonLabel" defaultMessage = "lon:" />
28- </ strong > { ' ' }
29- { _ . round ( mouseCoordinates . lon , DECIMAL_DEGREES_PRECISION ) } ,{ ' ' }
34+ { latLon }
3035 < strong >
3136 < FormattedMessage id = "xpack.maps.viewControl.zoomLabel" defaultMessage = "zoom:" />
3237 </ strong > { ' ' }
You can’t perform that action at this time.
0 commit comments