-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy pathAppContext.js
More file actions
773 lines (692 loc) · 28.8 KB
/
Copy pathAppContext.js
File metadata and controls
773 lines (692 loc) · 28.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
import React, { useContext, useEffect, useRef, useState } from 'react';
import LoginContext from '../context/LoginContext';
import { seleniumUpdateActivity, useMutator } from '../util/Utils';
import PoiManager, { getCategoryIcon } from '../manager/PoiManager';
import { apiGet, apiPost } from '../util/HttpApi';
import { geoRouter } from '../store/geoRouter/geoRouter.js';
import { geoObject } from '../store/geoObject/geoObject.js';
import isEmpty from 'lodash-es/isEmpty';
import cloneDeep from 'lodash-es/cloneDeep';
import { INTERACTIVE_LAYER } from '../map/layers/CustomTileLayer';
import { NO_HEIGHTMAP } from '../menu/configuremap/TerrainConfig';
import { GLOBAL_GRAPH_HEIGHT_SIZE } from '../manager/GlobalManager';
import { loadLocalTracksFromStorage } from './LocalTrackStorage';
import { units } from '../menu/settings/units/UnitsMenu';
import { getSortFromDB } from './FavoriteStorage';
import MarkerOptions from '../map/markers/MarkerOptions';
import {
EXPLORE_OBJS_KEY,
FAVORITES_KEY,
POI_OBJECTS_KEY,
SEARCH_RESULTS_KEY,
TRACKS_KEY,
} from '../util/hooks/menu/useRecentDataSaver';
import { useInitialFilesLoad, applyRefreshedInfoFilesToGpx } from '../util/hooks/useInitialFilesLoad';
import { loadSmartFolders } from '../manager/SmartFoldersManager';
import supportedLanguages from '../resources/translations/supportedLanguages.json';
import { normalizeLang } from '../util/lang';
export const collator = new Intl.Collator(supportedLanguages.map(normalizeLang), { numeric: true });
export const searchCollator = new Intl.Collator(supportedLanguages.map(normalizeLang), {
usage: 'search',
sensitivity: 'base',
});
export const OBJECT_TYPE_LOCAL_TRACK = 'local_track'; // track in localStorage
export const OBJECT_TYPE_CLOUD_TRACK = 'cloud_track'; // track in OsmAnd Cloud
export const OBJECT_TYPE_NAVIGATION_TRACK = 'route_track'; // track converted from Navigation result
export const OBJECT_TYPE_NAVIGATION_ALONE = 'navigation'; // special case of OBJECT_TYPE_NAVIGATION_TRACK (Navigation w/o InfoBlock)
export const OBJECT_TYPE_FAVORITE = 'favorite';
export const OBJECT_TYPE_WEATHER = 'weather';
export const OBJECT_TYPE_POI = 'poi';
export const OBJECT_TYPE_STOP = 'stop';
export const FAVORITES_URL_PARAM_FOLDER = 'folder';
export const TRAVEL_ROUTE_ID_PARAM = 'id';
export const OBJECT_CONFIGURE_MAP = 'configure_map';
export const OBJECT_SEARCH = 'search';
export const OBJECT_GLOBAL_SETTINGS = 'global_settings';
export const OBJECT_TRACK_ANALYZER = 'track_analyzer';
export const LOCAL_STORAGE_CONFIGURE_MAP = 'configureMap';
export const LOCAL_STORAGE_UNITS_SETTINGS = 'unitsSettings';
export const PREVIOUS_ROUTE_STORAGE_KEY = 'previousRoute';
export const OBJECT_TYPE_TRAVEL = 'travel';
export const OBJECT_TYPE_SHARE_FILE = 'share_file';
export const MAX_RECENT_OBJS = 5;
export const defaultConfigureMapStateValues = {
showFavorites: true,
showTransportStops: false,
pois: [],
showTracks: true,
terrain: NO_HEIGHTMAP.key,
};
export const isLocalTrack = (ctx) => ctx.currentObjectType === OBJECT_TYPE_LOCAL_TRACK;
export const isCloudTrack = (ctx) => ctx.currentObjectType === OBJECT_TYPE_CLOUD_TRACK;
export const isRouteTrack = (ctx) => ctx.currentObjectType === OBJECT_TYPE_NAVIGATION_TRACK;
export const isTravelTrack = (ctx) => ctx.currentObjectType === OBJECT_TYPE_TRAVEL;
export const isShareTrack = (ctx) => ctx.currentObjectType === OBJECT_TYPE_SHARE_FILE;
export const isTrack = (ctx) =>
isLocalTrack(ctx) || isCloudTrack(ctx) || isRouteTrack(ctx) || isTravelTrack(ctx) || isShareTrack(ctx);
export const isTrackAnalyzer = (ctx) => ctx.currentObjectType === OBJECT_TRACK_ANALYZER;
const osmandTileURL = {
uiname: 'Mapnik (tiles)',
key: 'mapniktile',
tileSize: 512,
url: 'https://tile.osmand.net/hd/{z}/{x}/{y}.png',
};
async function loadTileUrls(setAllTileURLs) {
const response = await apiGet(`${process.env.REACT_APP_TILES_API_SITE}/tile/styles`, {});
if (response.ok) {
let data = await response.json();
data[INTERACTIVE_LAYER] = createInteractiveMap(data, 'hd');
Object.values(data).forEach((item) => {
item.tileSize = 256 << item.tileSizeLog;
item.url = process.env.REACT_APP_TILES_API_SITE + '/tile/' + item.key + '/{z}/{x}/{y}.png';
if (item.key === INTERACTIVE_LAYER) {
item.infoUrl =
process.env.REACT_APP_TILES_API_SITE + '/tile/' + 'info/' + item.key + '/{z}/{x}/{y}.json';
}
item.uiname = item.name.charAt(0).toUpperCase() + item.name.slice(1);
if (item.tileSize > 256) {
item.uiname += ' HD';
}
});
data[osmandTileURL.key] = osmandTileURL;
setAllTileURLs(data);
}
}
function createInteractiveMap(data, type) {
let interactiveMap = cloneDeep(data[type]);
const name = type === 'hd' ? INTERACTIVE_LAYER : `${INTERACTIVE_LAYER}-${type}`;
interactiveMap.name = 'Interactive';
interactiveMap.key = name;
return interactiveMap;
}
const AppContext = React.createContext();
export const AppContextProvider = (props) => {
const { loginUser } = useContext(LoginContext);
seleniumUpdateActivity();
const [processingSaveTrack, setProcessingSaveTrack] = useState(false);
const [globalConfirmation, setGlobalConfirmation] = useState(null);
const [openMenu, setOpenMenu] = useState(null);
const [openContextMenu, setOpenContextMenu] = useState(false);
const [cloudSettings, setCloudSettings] = useState({
changes: false,
trash: false,
});
const [unitsSettings, setUnitsSettings] = useState(getUnitsSettings);
const [notification, setNotification] = useState(null);
const [zoomToCoords, setZoomToCoords] = useState(null);
//pages
const [prevPageUrl, setPrevPageUrl] = useState(null);
const [pageParams, setPageParams] = useState({});
const [gpxLoading, setGpxLoading] = useState(false);
const [smartFoldersLoading, setSmartFoldersLoading] = useState(false);
const [localTracksLoading, setLocalTracksLoading] = useState(false);
// files
const [listFiles, setListFiles] = useState({});
const [updateFiles, setUpdateFiles] = useState(null);
const [gpxFiles, mutateGpxFiles, setGpxFiles] = useMutator({});
// search
const searchTooltipRef = useRef(null);
const searchPointerRef = useRef(null);
const selectedUpdatedLayerRef = useRef(null); // layer whose icon we replaced — restore on cleanup
const selectedCreatedLayerRef = useRef(null); // layer we created — remove on cleanup
const selectedHiddenLayersRef = useRef([]); // layers hidden near selected marker — restore when selection changes
const [searchQuery, setSearchQuery] = useState(null);
const [searchResult, setSearchResult] = useState(null);
const [forceSearch, setForceSearch] = useState(false);
const [selectedSearchMarker, setSelectedSearchMarker] = useState(null);
const [processingSearch, setProcessingSearch] = useState(false);
const [moveToMapObj, setMoveToMapObj] = useState(null);
const [visibleBounds, setVisibleBounds] = useState(null);
const [exploreMenu, setExploreMenu] = useState(false);
const [poiCatMenu, setPoiCatMenu] = useState(false);
const [poiByUrl, setPoiByUrl] = useState(null);
const [stopByUrl, setStopByUrl] = useState(null);
// travel
const [openTravel, setOpenTravel] = useState(false);
const [travelFilter, setTravelFilter] = useState(null);
const [searchTravelRoutes, setSearchTravelRoutes] = useState(null);
const [selectedTravelRoute, setSelectedTravelRoute] = useState(null);
const [selectedTransportRoute, setSelectedTransportRoute] = useState(null);
const [travelRouteIdByUrl, setTravelRouteIdByUrl] = useState(null);
// share
const [shareFile, setShareFile] = useState(null);
const [updatedRequestList, setUpdatedRequestList] = useState([]);
const [shareFileMarkers, setShareFileMarkers] = useState(null);
const [shareFilesCache, setShareFilesCache] = useState({});
const [shareWithMeFiles, setShareWithMeFiles] = useState(null);
const [fitBoundsShareTracks, setFitBoundsShareTracks] = useState(null);
const [smartFoldersCache, setSmartFoldersCache] = useState(null);
// selected track
const [selectedGpxFile, setSelectedGpxFile] = useState({});
const [unverifiedGpxFile, setUnverifiedGpxFile] = useState(null); // see Effect in LocalClientTrackLayer
const [mapMarkerListener, setMapMarkerListener] = useState(null);
const [tracksGroups, setTracksGroups] = useState([]);
const [allTileURLs, setAllTileURLs] = useState({});
// favorites
const [favorites, setFavorites] = useState({});
const [updateMarkers, setUpdateMarkers] = useState(null);
const [addFavorite, setAddFavorite] = useState({
add: false,
location: null,
});
const [exitGuards, setExitGuards] = useState({});
const [processingGroups, setProcessingGroups] = useState(false);
const [favLoading, setFavLoading] = useState(false);
const [removeFavGroup, setRemoveFavGroup] = useState(null);
const [wptRecents, setWptRecents] = useState({
icons: new Set([MarkerOptions.DEFAULT_WPT_ICON]),
groups: [],
});
const [localTracks, setLocalTracks] = useState([]);
const [visibleTracks, setVisibleTracks] = useState({});
const [openVisibleMenu, setOpenVisibleMenu] = useState({
open: false,
showTracks: false,
showConfig: false,
});
const [currentObjectType, setCurrentObjectType] = useState(null);
const [headerText, setHeaderText] = useState({
search: { text: '' },
weather: { text: '' },
tracks: { text: '' },
route: { text: '' },
welcome: { text: process.env.REACT_APP_WEBSITE_NAME },
});
const [createTrack, setCreateTrack] = useState(null);
const [loadingContextMenu, setLoadingContextMenu] = useState(false);
const [loadingContextItem, setLoadingContextItem] = useState(null);
const [updateInfoBlock, setUpdateInfoBlock] = useState(false);
const [trackProfileManager, setTrackProfileManager] = useState({});
const [pointContextMenu, setPointContextMenu] = useState({});
const [routingErrorMsg, setRoutingErrorMsg] = useState(null);
const [trackErrorMsg, setTrackErrorMsg] = useState(null);
const [trackState, setTrackState] = useState({
update: false, // push track to undo/redo
// pastStates: [], // was used for logs
// futureStates: [], // was used for logs
});
const [openedPopper, setOpenedPopper] = useState(null);
//poi
const [showPoiCategories, setShowPoiCategories] = useState([]);
const [showPoiConfig, setShowPoiConfig] = useState([]);
const [poiCategory, setPoiCategories] = useState(null);
const [poiIconCache, setPoiIconCache] = useState({});
const [categoryIcons, setCategoryIcons] = useState({});
const [wikiPlaces, setWikiPlaces] = useState(null);
const [photoGallery, setPhotoGallery] = useState(null);
const [selectedPhotoInd, setSelectedPhotoInd] = useState(-1);
const [searchSettings, setSearchSettings] = useState({});
const [routingCache, mutateRoutingCache] = useMutator({});
const [routingNewSegments, setRoutingNewSegments] = useState([]);
const [processRouting, setProcessRouting] = useState(false);
const [navigationRoutingInProgress, setNavigationRoutingInProgress] = useState(false);
const [selectedWpt, setSelectedWpt] = useState(null);
const [routeTrackFile, setRouteTrackFile] = useState(null);
const [routeVisibleProfiles, setRouteVisibleProfiles] = useState(null);
const [viaInputsCount, setViaInputsCount] = useState(0);
const [trackLoading, setTrackLoading] = useState([]);
const [routeObject, setRouteObject] = useState(() => new geoObject());
const [trackRouter, setTrackRouter] = useState(() => new geoRouter());
const [afterPointRouter, setAfterPointRouter] = useState(() => new geoRouter());
const [beforePointRouter, setBeforePointRouter] = useState(() => new geoRouter());
const [selectedWptId, setSelectedWptId] = useState(null);
const [navigationHistory, setNavigationHistory] = useState([]);
const [previousRoute, setPreviousRoute] = useState(() => {
try {
const s = localStorage.getItem(PREVIOUS_ROUTE_STORAGE_KEY);
return s ? JSON.parse(s) : null;
} catch {
return null;
}
});
routeObject.initSetter({ setter: setRouteObject });
trackRouter.initSetter({ setter: setTrackRouter });
afterPointRouter.initSetter({ setter: setAfterPointRouter });
beforePointRouter.initSetter({ setter: setBeforePointRouter });
const [trackRange, setTrackRange] = useState(null);
const [showPoints, mutateShowPoints] = useMutator({
points: true,
wpts: true,
});
const [develFeatures, setDevelFeatures] = useState(process.env.REACT_APP_DEVEL_FEATURES === 'yes');
const [infoBlockWidth, setInfoBlockWidth] = useState('0');
const [configureMapState, setConfigureMapState] = useState(getConfigureMap);
// ex. tracks:{"": 'za', new!!!: 'za'}
const [selectedSort, setSelectedSort] = useState({});
const [openProFeatures, setOpenProFeatures] = useState(null);
// track analyzer
const [trackAnalyzer, setTrackAnalyzer] = useState(null);
const [excludedSegments, setExcludedSegments] = useState(new Set());
const [graphHighlightedPoint, setGraphHighlightedPoint] = useState(null);
const [sortedSegments, setSortedSegments] = useState(null);
const [recentObjs, setRecentObjs] = useState({
[TRACKS_KEY]: [],
[FAVORITES_KEY]: [],
[POI_OBJECTS_KEY]: [],
[EXPLORE_OBJS_KEY]: [],
[SEARCH_RESULTS_KEY]: [],
});
const [selectedFavoriteObj, setSelectedFavoriteObj] = useState(null);
const [selectedCloudTrackObj, setSelectedCloudTrackObj] = useState(null);
const [selectedLocalTrackObj, setSelectedLocalTrackObj] = useState(null);
const [selectedPoiObj, setSelectedPoiObj] = useState(null);
const [selectedSearchObj, setSelectedSearchObj] = useState(null);
// Group IDs of favorites visible in current search results — their map markers must always show.
const [searchFavoriteGroupIds, setSearchFavoriteGroupIds] = useState(null);
const [processingPoiByUrl, setProcessingPoiByUrl] = useState(false);
const [processingStopByUrl, setProcessingStopByUrl] = useState(false);
const [processingTravelRouteByUrl, setProcessingTravelRouteByUrl] = useState(false);
const [closeMapObj, setCloseMapObj] = useState(false);
const [saveTrackToCloud, setSaveTrackToCloud] = useState(false);
const [processingAnalytics, setProcessingAnalytics] = useState(false);
const [openNavigationSettings, setOpenNavigationSettings] = useState(false);
useEffect(() => {
async function loadSort() {
try {
const sort = await getSortFromDB();
if (sort) {
setSelectedSort(sort);
}
} catch (e) {
console.error('Failed to load sort from DB', e);
}
}
loadSort().then();
}, []);
// global graph
const [globalGraph, setGlobalGraph] = useState({
show: false,
size: GLOBAL_GRAPH_HEIGHT_SIZE,
});
function getConfigureMap() {
const TIME_UPDATE_CONFIGURE_MAP = 1744806975000; // 2025-04-16
let savedConfigureMap = localStorage.getItem(LOCAL_STORAGE_CONFIGURE_MAP);
if (savedConfigureMap) {
savedConfigureMap = JSON.parse(savedConfigureMap);
if (!savedConfigureMap.updateTime || savedConfigureMap.updateTime < TIME_UPDATE_CONFIGURE_MAP) {
savedConfigureMap = defaultConfigureMapStateValues;
savedConfigureMap.updateTime = TIME_UPDATE_CONFIGURE_MAP;
localStorage.setItem(LOCAL_STORAGE_CONFIGURE_MAP, JSON.stringify(savedConfigureMap));
return defaultConfigureMapStateValues;
}
// Normalize saved data to ensure all default fields are present
savedConfigureMap = { ...defaultConfigureMapStateValues, ...savedConfigureMap };
if (!isEmpty(savedConfigureMap.pois)) {
setShowPoiCategories(savedConfigureMap.pois);
}
return savedConfigureMap;
}
return defaultConfigureMapStateValues;
}
function getUnitsSettings() {
const saved = localStorage.getItem(LOCAL_STORAGE_UNITS_SETTINGS);
if (saved) {
return JSON.parse(saved);
}
return {
len: units.len.defaultValue,
speed: units.speed.defaultValue,
};
}
useEffect(() => {
Object.keys(localStorage).forEach((name) => {
if (name.startsWith('localTrack_') || name.startsWith('favorites')) {
localStorage.removeItem(name);
}
});
loadLocalTracksFromStorage(setLocalTracksLoading).then((tracks) => {
setLocalTracks(tracks);
});
}, []);
useEffect(() => {
PoiManager.getPoiCategories(setLocalTracksLoading).then((categories) => {
PoiManager.getTopPoiFilters(setLocalTracksLoading).then((filters) => {
setPoiCategories({
categories: categories,
filters: removeUnusedFilters(filters),
});
});
});
function removeUnusedFilters(filters) {
if (filters) {
return filters.filter((f) => f !== 'routes');
}
return null;
}
}, []);
useEffect(() => {
async function loadIcons() {
const icons = {};
const filters = poiCategory?.filters;
if (filters) {
for (const filter of filters) {
icons[filter] = await getCategoryIcon(filter);
}
setCategoryIcons(icons);
}
}
if (isEmpty(categoryIcons) && poiCategory !== null && poiCategory?.filters !== null) {
loadIcons().then();
}
}, [poiCategory?.filters]);
useEffect(() => {
const sequentialLoad = async () => {
await routeObject.loadProviders({ parseQueryString: true });
await trackRouter.loadProviders();
await afterPointRouter.loadProviders();
await beforePointRouter.loadProviders();
};
sequentialLoad();
}, []);
useEffect(() => {
loadTileUrls(setAllTileURLs);
}, []);
useEffect(() => {
const update = async () => {
if (updateFiles && !isEmpty(listFiles)) {
setSmartFoldersLoading(true);
const response = await apiPost(
`${process.env.REACT_APP_USER_API_SITE}/mapapi/refresh-list-files`,
updateFiles
);
if (response.ok) {
const updatedData = await response.json();
setListFiles((prev) => {
if (!prev.uniqueFiles) return prev;
const updatedUniqueFiles = prev.uniqueFiles.map((file) => {
const updatedFile = updatedData.find((f) => f.id === file.id);
return updatedFile ? { ...file, details: updatedFile.details } : file;
});
return {
...prev,
uniqueFiles: updatedUniqueFiles,
};
});
loadSmartFolders(setTracksGroups, setSmartFoldersCache)
.then(() => {
setSmartFoldersLoading(false);
})
.catch(() => {
setSmartFoldersLoading(false);
});
applyRefreshedInfoFilesToGpx(updatedData, setGpxFiles, setSelectedGpxFile);
}
}
};
update().then(() => {
setUpdateFiles(null);
});
}, [updateFiles]);
useInitialFilesLoad({
loginUser,
listFiles,
setListFiles,
gpxFiles,
setGpxFiles,
setFavorites,
setUpdateMarkers,
setProcessingGroups,
setVisibleTracks,
setShareWithMeFiles,
setTracksGroups,
setSmartFoldersCache,
setUpdateFiles,
setSmartFoldersLoading,
setGpxLoading,
});
const [openGroups, setOpenGroups] = useState([]);
const [stopUseGeoLocation, setStopUseGeoLocation] = useState(false);
return (
<AppContext.Provider
value={{
globalConfirmation,
setGlobalConfirmation,
listFiles,
setListFiles,
gpxFiles,
setGpxFiles,
mutateGpxFiles,
gpxLoading,
setGpxLoading,
smartFoldersLoading,
setSmartFoldersLoading,
selectedGpxFile,
setSelectedGpxFile,
unverifiedGpxFile,
setUnverifiedGpxFile,
mapMarkerListener,
setMapMarkerListener,
allTileURLs,
trackRouter,
afterPointRouter,
beforePointRouter,
routeTrackFile,
setRouteTrackFile,
routeVisibleProfiles,
setRouteVisibleProfiles,
searchQuery,
setSearchQuery,
forceSearch,
setForceSearch,
favorites,
setFavorites,
addFavorite,
setAddFavorite,
exitGuards,
setExitGuards,
localTracks,
setLocalTracks,
currentObjectType,
setCurrentObjectType,
headerText,
setHeaderText,
tracksGroups,
setTracksGroups,
createTrack,
setCreateTrack,
loadingContextMenu,
setLoadingContextMenu,
updateInfoBlock,
setUpdateInfoBlock,
trackProfileManager,
setTrackProfileManager,
routingErrorMsg,
setRoutingErrorMsg,
pointContextMenu,
setPointContextMenu,
trackState,
setTrackState,
localTracksLoading,
setLocalTracksLoading,
openedPopper,
setOpenedPopper,
routingCache,
mutateRoutingCache,
poiIconCache,
setPoiIconCache,
routingNewSegments,
setRoutingNewSegments,
processRouting,
setProcessRouting,
navigationRoutingInProgress,
setNavigationRoutingInProgress,
selectedWpt,
setSelectedWpt,
trackRange,
setTrackRange,
showPoints,
mutateShowPoints,
showPoiCategories,
setShowPoiCategories,
poiCategory,
setPoiCategories,
develFeatures,
setDevelFeatures,
infoBlockWidth,
setInfoBlockWidth,
routeObject,
openGroups,
setOpenGroups,
trackErrorMsg,
setTrackErrorMsg,
trackLoading,
setTrackLoading,
stopUseGeoLocation,
setStopUseGeoLocation,
configureMapState,
setConfigureMapState,
updateMarkers,
setUpdateMarkers,
processingGroups,
setProcessingGroups,
selectedSort,
setSelectedSort,
visibleTracks,
setVisibleTracks,
wikiPlaces,
setWikiPlaces,
searchSettings,
setSearchSettings,
loadingContextItem,
setLoadingContextItem,
selectedWptId,
setSelectedWptId,
openMenu,
setOpenMenu,
openContextMenu,
setOpenContextMenu,
prevPageUrl,
setPrevPageUrl,
pageParams,
setPageParams,
photoGallery,
setPhotoGallery,
selectedPhotoInd,
setSelectedPhotoInd,
openVisibleMenu,
setOpenVisibleMenu,
cloudSettings,
setCloudSettings,
categoryIcons,
setCategoryIcons,
searchResult,
setSearchResult,
processingSearch,
setProcessingSearch,
searchTooltipRef,
searchPointerRef,
selectedUpdatedLayerRef,
selectedCreatedLayerRef,
selectedHiddenLayersRef,
favLoading,
setFavLoading,
searchTravelRoutes,
setSearchTravelRoutes,
selectedTravelRoute,
setSelectedTravelRoute,
selectedTransportRoute,
setSelectedTransportRoute,
travelRouteIdByUrl,
setTravelRouteIdByUrl,
travelFilter,
setTravelFilter,
openProFeatures,
setOpenProFeatures,
selectedSearchMarker,
setSelectedSearchMarker,
moveToMapObj,
setMoveToMapObj,
shareFile,
setShareFile,
updatedRequestList,
setUpdatedRequestList,
shareFileMarkers,
setShareFileMarkers,
shareFilesCache,
setShareFilesCache,
shareWithMeFiles,
setShareWithMeFiles,
fitBoundsShareTracks,
setFitBoundsShareTracks,
smartFoldersCache,
setSmartFoldersCache,
trackAnalyzer,
setTrackAnalyzer,
excludedSegments,
setExcludedSegments,
globalGraph,
setGlobalGraph,
processingSaveTrack,
setProcessingSaveTrack,
graphHighlightedPoint,
setGraphHighlightedPoint,
sortedSegments,
setSortedSegments,
updateFiles,
setUpdateFiles,
unitsSettings,
setUnitsSettings,
removeFavGroup,
setRemoveFavGroup,
notification,
setNotification,
wptRecents,
setWptRecents,
recentObjs,
setRecentObjs,
selectedFavoriteObj,
setSelectedFavoriteObj,
selectedCloudTrackObj,
setSelectedCloudTrackObj,
visibleBounds,
setVisibleBounds,
exploreMenu,
setExploreMenu,
openTravel,
setOpenTravel,
poiCatMenu,
setPoiCatMenu,
selectedPoiObj,
setSelectedPoiObj,
selectedSearchObj,
setSelectedSearchObj,
searchFavoriteGroupIds,
setSearchFavoriteGroupIds,
zoomToCoords,
setZoomToCoords,
poiByUrl,
setPoiByUrl,
stopByUrl,
setStopByUrl,
closeMapObj,
setCloseMapObj,
saveTrackToCloud,
setSaveTrackToCloud,
selectedLocalTrackObj,
setSelectedLocalTrackObj,
showPoiConfig,
setShowPoiConfig,
processingPoiByUrl,
setProcessingPoiByUrl,
processingStopByUrl,
setProcessingStopByUrl,
processingTravelRouteByUrl,
setProcessingTravelRouteByUrl,
processingAnalytics,
setProcessingAnalytics,
openNavigationSettings,
setOpenNavigationSettings,
navigationHistory,
setNavigationHistory,
previousRoute,
setPreviousRoute,
viaInputsCount,
setViaInputsCount,
navigationObject: routeObject,
}}
>
{props.children}
</AppContext.Provider>
);
};
export default AppContext;