Skip to content

Commit

Permalink
Merge pull request #338 from wearepal/kew-data
Browse files Browse the repository at this point in the history
scale line on map view
  • Loading branch information
paulthatjazz authored Feb 15, 2024
2 parents d3342b8 + 30d2b7c commit 8cd4eb4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/javascript/projects/map_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { Feature, Map, View } from 'ol'
import { Control, defaults as defaultControls } from 'ol/control'
import { Control, ScaleLine, defaults as defaultControls } from 'ol/control'
import { Extent, createEmpty as createEmptyExtent, extend, isEmpty } from 'ol/extent'
import olBaseLayer from 'ol/layer/Base'
import VectorLayer from 'ol/layer/Vector'
Expand Down Expand Up @@ -107,7 +107,13 @@ export const MapView = ({ layers, dbModels, initialZoom, setZoom, initialCenter,
zoomInLabel: createIconElement("search-plus"),
zoomOutLabel: createIconElement("search-minus")
}
}).extend([new FitViewControl()]),
}).extend([
new FitViewControl(),
new ScaleLine({
units: 'metric',
minWidth: 200
})
]),
target: mapRef.current
});

Expand Down

0 comments on commit 8cd4eb4

Please sign in to comment.