added option to the field minimap and the field bounds for the options to adjust the bounds to make them squared for longer/taller fields
This commit is contained in:
parent
3802691977
commit
b3a8a3b25f
3 changed files with 18 additions and 5 deletions
|
|
@ -136,7 +136,7 @@ const columns: Column<Field>[] = [
|
|||
render: row => {
|
||||
return (
|
||||
<Box margin={1} height={200} width={200}>
|
||||
<FieldMinimap field={row} />
|
||||
<FieldMinimap field={row} squared borderSpacing={0.001}/>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ import { GeometryMapping } from "models/GeometryMapping";
|
|||
|
||||
interface Props {
|
||||
field: Field
|
||||
squared?: boolean
|
||||
borderSpacing?: number
|
||||
}
|
||||
|
||||
export default function FieldMinimap(props: Props) {
|
||||
const { field } = props
|
||||
const { field, squared, borderSpacing } = props
|
||||
const MAPBOX_TOKEN = import.meta.env.VITE_MAPBOX_ACCESS_TOKEN;
|
||||
const [geoCollection, setGeoCollection] = useState<FeatureCollection>();
|
||||
|
||||
|
|
@ -42,7 +44,7 @@ export default function FieldMinimap(props: Props) {
|
|||
<Map
|
||||
zoom={1}
|
||||
maxBounds={
|
||||
field.fieldBounds(.001)
|
||||
field.fieldBounds(borderSpacing, squared)
|
||||
}
|
||||
reuseMaps
|
||||
style={{width: "100%", height: "100%"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue