\n {this._renderMarker()}\n
e.preventDefault()}\n >\n {this._renderButton('geolocate', label, this._onClickGeolocate)}\n
\n
\n );\n }\n}\n","// @flow\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport BaseControl from './base-control';\n\nimport MapState from '../utils/map-state';\nimport {LINEAR_TRANSITION_PROPS} from '../utils/map-controller';\n\nimport deprecateWarn from '../utils/deprecate-warn';\nimport {compareVersions} from '../utils/version';\n\nimport type {BaseControlProps} from './base-control';\n\nconst noop = () => {};\n\nconst propTypes = Object.assign({}, BaseControl.propTypes, {\n // Custom className\n className: PropTypes.string,\n // Callbacks fired when the user interacted with the map. The object passed to the callbacks\n // contains viewport properties such as `longitude`, `latitude`, `zoom` etc.\n onViewStateChange: PropTypes.func,\n onViewportChange: PropTypes.func,\n // Show/hide compass button\n showCompass: PropTypes.bool,\n // Show/hide zoom buttons\n showZoom: PropTypes.bool,\n // Custom labels assigned to the controls\n zoomInLabel: PropTypes.string,\n zoomOutLabel: PropTypes.string,\n compassLabel: PropTypes.string\n});\n\nconst defaultProps = Object.assign({}, BaseControl.defaultProps, {\n className: '',\n showCompass: true,\n showZoom: true,\n zoomInLabel: 'Zoom In',\n zoomOutLabel: 'Zoom Out',\n compassLabel: 'Reset North'\n});\n\nexport type NavigationControlProps = BaseControlProps & {\n className: string,\n onViewStateChange?: Function,\n onViewportChange?: Function,\n showCompass: boolean,\n showZoom: boolean,\n zoomInLabel: string,\n zoomOutLabel: string,\n compassLabel: string\n};\n\ntype ViewportProps = {\n longitude: number,\n latitude: number,\n zoom: number,\n pitch: number,\n bearing: number\n};\n\n// Mapbox version flags. CSS classes were changed in certain versions.\nconst VERSION_LEGACY = 1;\nconst VERSION_1_6 = 2;\n\nfunction getUIVersion(mapboxVersion: string): number {\n return compareVersions(mapboxVersion, '1.6.0') >= 0 ? VERSION_1_6 : VERSION_LEGACY;\n}\n\n/*\n * PureComponent doesn't update when context changes, so\n * implementing our own shouldComponentUpdate here.\n */\nexport default class NavigationControl extends BaseControl<\n NavigationControlProps,\n *,\n HTMLDivElement\n> {\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n constructor(props: NavigationControlProps) {\n super(props);\n // Check for deprecated props\n deprecateWarn(props);\n }\n\n _uiVersion: number;\n\n _updateViewport(opts: $Shape