@@ -3,7 +3,7 @@ import type Map from 'ol/Map'
33import useAreaOfInterest from './useAreaOfInterest'
44import useMap from './useMap'
55import useSearch from './useSearch'
6- import useSettings from './useSettings'
6+ import useSettings , { defaultThreshold } from './useSettings'
77import { fromLonLat , toLonLat , transformExtent } from 'ol/proj'
88import { type Extent } from 'ol/extent'
99import { type Coordinate } from 'ol/coordinate'
@@ -58,7 +58,7 @@ export default function usePermalink() {
5858 zoom : 2 ,
5959 center : [ 0 , 0 ] ,
6060 year : 2025 ,
61- threshold : 0.4 ,
61+ threshold : defaultThreshold ,
6262 fieldBoundariesOpacity : 90 ,
6363 }
6464
@@ -180,8 +180,10 @@ export default function usePermalink() {
180180
181181 for ( const part of keyValueParts ) {
182182 if ( part . startsWith ( 'threshold:' ) ) {
183- const val = parseFloat ( part . substring ( 10 ) )
184- if ( ! isNaN ( val ) ) result . threshold = val
183+ const val = parseInt ( part . substring ( 10 ) , 10 )
184+ if ( ! isNaN ( val ) ) {
185+ result . threshold = val
186+ }
185187 } else if ( part . startsWith ( 'year:' ) ) {
186188 const year = parseInt ( part . substring ( 5 ) , 10 )
187189 if ( ! isNaN ( year ) ) result . year = year
@@ -286,7 +288,7 @@ export default function usePermalink() {
286288 }
287289 } else {
288290 // Global mode
289- hashParts . push ( `threshold:${ settings . value . threshold } ` )
291+ hashParts . push ( `threshold:${ Math . round ( settings . value . threshold ) } ` )
290292 if ( settings . value . year ) {
291293 hashParts . push ( `year:${ settings . value . year } ` )
292294 }
0 commit comments