File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ const Map = (props) => {
4545 const { userParams, setUserParams } = useAppContext ( ) ;
4646 const { url, attribution } = whichMap ( 'Stadia.AlidadeSmooth' ) ;
4747 const markerRef = useRef ( null ) ;
48+ const userParamsRef = useRef ( ) ;
49+
50+ useEffect ( ( ) => {
51+ userParamsRef . current = userParams ;
52+ } , [ userParams ] ) ;
4853
4954 useEffect ( ( ) => {
5055 if ( ! userParams . geometry && markerRef . current ) {
@@ -65,7 +70,7 @@ const Map = (props) => {
6570 */
6671 function onCreated ( e ) {
6772 markerRef . current = e . layer ;
68- setUserParams ( { ...userParams , geometry : {
73+ setUserParams ( { ...userParamsRef . current , geometry : {
6974 "type" : "Point" ,
7075 "coordinates" : [ e . layer . _latlng . lng , e . layer . _latlng . lat ]
7176 }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const today = new Date();
99const defaultUserParams = {
1010 dateRange : [
1111 today ,
12- new Date ( new Date ( today ) . setDate ( today . getDate ( ) + 3 ) ) ,
12+ new Date ( new Date ( today ) . setDate ( today . getDate ( ) + 14 ) ) ,
1313 ] ,
1414 provider : 'all' ,
1515 product : 'all'
You can’t perform that action at this time.
0 commit comments