Skip to content

Commit

Permalink
Add scale bar Leaflet control to TaskBundleWidget (#2069)
Browse files Browse the repository at this point in the history
* added react-leaflet control to taskbundlewidget
  • Loading branch information
AndrewPhilbin authored Aug 31, 2023
1 parent 67a08ef commit 18454fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/TaskClusterMap/TaskClusterMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react'
import { FormattedMessage } from 'react-intl'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import { ZoomControl, Marker, LayerGroup, Rectangle, Polyline, Pane, Tooltip }
import { ZoomControl, ScaleControl, Marker, LayerGroup, Rectangle, Polyline, Pane, Tooltip }
from 'react-leaflet'
import { latLng } from 'leaflet'
import bbox from '@turf/bbox'
Expand Down Expand Up @@ -714,6 +714,7 @@ export class TaskClusterMap extends Component {
onZoomOrMoveStart={this.debouncedUpdateBounds.cancel}
>
<ZoomControl className="mr-z-10" position='topright' />
{this.props.showScaleControl && <ScaleControl className="mr-z-10" position='bottomleft'/>}
{this.props.showFitWorld && <FitWorldControl />}
{this.props.taskCenter &&
<FitBoundsControl key={this.props.taskCenter.toString()} centerPoint={this.props.taskCenter} />
Expand Down
4 changes: 4 additions & 0 deletions src/components/TaskClusterMap/TaskClusterMap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
.leaflet-container {
height: 100%;
}

.leaflet-control-scale {
top: 0px !important;
}
}

.greyscale-cluster {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ const BuildBundle = props => {
allowClusterToggle={false}
hideSearchControl
allowSpidering
showScaleControl
showSelectMarkersInView
{..._omit(props, 'className')}
/>
Expand Down

0 comments on commit 18454fb

Please sign in to comment.