@@ -4,7 +4,10 @@ import { loadConfig } from "terriajs/lib/Core/loadConfig";
44import { ServerConfig } from "terriajs/lib/Core/ServerConfig" ;
55import registerCatalogMembers from "terriajs/lib/Models/Catalog/registerCatalogMembers" ;
66import { FeedbackService } from "terriajs/lib/Models/FeedbackService" ;
7- import { parseHashParams } from "terriajs/lib/Models/HashParams" ;
7+ import {
8+ applyHashParamsToConfig ,
9+ parseHashParams
10+ } from "terriajs/lib/Models/HashParams" ;
811import {
912 buildInitSourcesFromConfig ,
1013 updateInitSourcesFromUrl
@@ -20,6 +23,8 @@ import URI from "urijs";
2023import loadPlugins from "./lib/Core/loadPlugins" ;
2124import showGlobalDisclaimer from "./lib/Views/showGlobalDisclaimer" ;
2225import plugins from "./plugins" ;
26+ import { PersistedSettingsService } from "terriajs/lib/Models/PersistedSettings" ;
27+ import { ShareLinkService } from "terriajs/lib/ReactViews/Map/Panels/SharePanel/BuildShareLink" ;
2328
2429// Register all types of catalog members in the core TerriaJS. If you only want to register a subset of them
2530// (i.e. to reduce the size of your application if you don't actually use them all), feel free to copy a subset of
@@ -54,7 +59,9 @@ export default (async () => {
5459 // insert your custom version of the code in the registerCustomComponentTypes function here instead.
5560 registerCustomComponentTypes ( terria ) ;
5661
57- await terria . setHashParams ( hashParams ) . initLanguage ( ) ;
62+ applyHashParamsToConfig ( terria , hashParams ) ;
63+
64+ await terria . initLanguage ( ) ;
5865
5966 if ( config . parameters . feedbackUrl ) {
6067 terria . setFeedbackService (
@@ -70,7 +77,9 @@ export default (async () => {
7077 shareMaxRequestSize : serverConfig ?. shareMaxRequestSize ,
7178 shareMaxRequestSizeBytes : serverConfig ?. shareMaxRequestSizeBytes
7279 } ) ;
73- terria . setShareDataService ( shareDataService ) ;
80+ terria . setShareLinkService (
81+ new ShareLinkService ( terria , shareDataService , hashParams )
82+ ) ;
7483
7584 terria . initCorsProxy ( {
7685 proxyAllDomains : serverConfig ?. proxyAllDomains ,
@@ -85,6 +94,10 @@ export default (async () => {
8594 terria . setAnalyticsService ( new GoogleAnalytics ( ) ) ;
8695 }
8796
97+ terria . setPersistedSettingsService (
98+ new PersistedSettingsService ( config . parameters )
99+ ) ;
100+
88101 terria . initCatalogIndex ( ) . build ( ) ;
89102
90103 await loadPlugins ( viewState , plugins ) ;
0 commit comments