diff --git a/.gitignore b/.gitignore index 0eed0de1a..e68347b20 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,6 @@ deploy/work/ packages/ pancake/ yarn-error.log +.npmrc package-lock.json diff --git a/CHANGES.md b/CHANGES.md index c6df0d327..db2a31df2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,13 @@ - [The next improvement] +### `0.0.9` + +**2023-11-24** + +- Updated TerriaJS to `8.3.9`. +- Moved to new Search Provider model. Search Providers are now configured in `config.json` `searchProviders`. For example configuration see https://docs.terria.io/guide/customizing/search-providers/ + ### `0.0.8` **2023-08-11** diff --git a/index.js b/index.js index e4e271f52..6aabae7ed 100644 --- a/index.js +++ b/index.js @@ -5,24 +5,18 @@ var terriaOptions = { }; import { runInAction } from "mobx"; - -// checkBrowserCompatibility('ui'); import ConsoleAnalytics from "terriajs/lib/Core/ConsoleAnalytics"; import GoogleAnalytics from "terriajs/lib/Core/GoogleAnalytics"; import ShareDataService from "terriajs/lib/Models/ShareDataService"; // import registerAnalytics from 'terriajs/lib/Models/registerAnalytics'; -// import registerCatalogMembers from 'terriajs/lib/Models/registerCatalogMembers'; import registerCustomComponentTypes from "terriajs/lib/ReactViews/Custom/registerCustomComponentTypes"; import Terria from "terriajs/lib/Models/Terria"; import updateApplicationOnHashChange from "terriajs/lib/ViewModels/updateApplicationOnHashChange"; import updateApplicationOnMessageFromParentWindow from "terriajs/lib/ViewModels/updateApplicationOnMessageFromParentWindow"; import ViewState from "terriajs/lib/ReactViewModels/ViewState"; -import BingMapsSearchProviderViewModel from "terriajs/lib/Models/SearchProviders/BingMapsSearchProvider"; -// import GazetteerSearchProviderViewModel from 'terriajs/lib/ViewModels/GazetteerSearchProviderViewModel.js'; -// import GnafSearchProviderViewModel from 'terriajs/lib/ViewModels/GnafSearchProviderViewModel.js'; -// import defined from 'terriajs-cesium/Source/Core/defined'; import render from "./lib/Views/render"; import registerCatalogMembers from "terriajs/lib/Models/Catalog/registerCatalogMembers"; +import registerSearchProviders from "terriajs/lib/Models/SearchProviders/registerSearchProviders"; import defined from "terriajs-cesium/Source/Core/defined"; import loadPlugins from "./lib/Core/loadPlugins"; import plugins from "./plugins"; @@ -53,6 +47,9 @@ const viewState = new ViewState({ }); registerCatalogMembers(); +// Register custom search providers in the core TerriaJS. If you only want to register a subset of them, or to add your own, +// insert your custom version of the code in the registerSearchProviders function here instead. +registerSearchProviders(); if (process.env.NODE_ENV === "development") { window.viewState = viewState; @@ -87,15 +84,6 @@ module.exports = terria terria.loadInitSources().then((result) => result.raiseError(terria)); try { - viewState.searchState.locationSearchProviders = [ - new BingMapsSearchProviderViewModel({ - terria: terria, - key: terria.configParameters.bingMapsKey - }) - // new GazetteerSearchProviderViewModel({terria}), - // new GnafSearchProviderViewModel({terria}) - ]; - // Automatically update Terria (load new catalogs, etc.) when the hash part of the URL changes. updateApplicationOnHashChange(terria, window); updateApplicationOnMessageFromParentWindow(terria, window); diff --git a/package.json b/package.json index 926af2b0c..9bbd5f6fc 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ ] }, "name": "terriajs-map", - "version": "0.0.8", + "version": "0.0.9", "description": "Geospatial catalog explorer based on TerriaJS.", "license": "Apache-2.0", "engines": { @@ -74,7 +74,7 @@ "semver": "^5.0.0", "style-loader": "^0.23.1", "svg-sprite-loader": "4.1.3", - "terriajs": "8.3.2", + "terriajs": "8.3.9", "terriajs-cesium": "1.92.0-tile-error-provider-fix-2", "ts-loader": "^5.3.3", "typescript": "^4.9.5", diff --git a/wwwroot/config.json b/wwwroot/config.json index 031d979c3..c874fe106 100644 --- a/wwwroot/config.json +++ b/wwwroot/config.json @@ -5,10 +5,8 @@ "googleUrlShortenerKey": null, "googleAnalyticsKey": null, "googleAnalyticsOptions": null, - // Log ConsoleAnalytics events to console // logToConsole: true, - /* Text that appears at the bottom of the map */ "disclaimer": { "text": "Disclaimer: This map must not be used for navigation or precise spatial analysis", @@ -21,7 +19,6 @@ url: "#" }, */ - // Pop-up disclaimer that will be shown at the start // The text of the disclaimer is in lib/Views/GlobalDisclaimer.html // globalDisclaimer: { @@ -34,7 +31,6 @@ // //devHostRegex: "\\b(staging|preview|test|dev)\\.", // enableOnLocalhost: true // If false, don't show this when running on localhost // }, - /* developerAttribution: { text: "Your organisation", @@ -42,7 +38,6 @@ },*/ // This is used in various text messages. You should also set in index.html "appName": "Terria Map", - // See comments in lib/Views/global.scss for further information about customising colors, logos, fonts etc. "brandBarElements": [ "", @@ -55,7 +50,6 @@ "proj4ServiceBaseUrl": "proj4def/", // Or this "feedbackUrl": "feedback", - // Default mobile viewer mode when loading the map for the first time on mobile platforms. // Options are: "3DTerrain", "3DSmooth", "2D" "mobileDefaultViewerMode": "2d", @@ -71,10 +65,8 @@ // "videoUrl": "https://www.youtube-nocookie.com/embed/NTtSM70rIvI", // use an embedded video link // "placeholderImage": "https://img.youtube.com/vi/NTtSM70rIvI/maxresdefault.jpg" // }, - // True to display in-app guides. // "showInAppGuides": false, - // see `languageOverrides.json` in languages/en "languageConfiguration": { "enabled": false, @@ -85,6 +77,16 @@ }, "fallbackLanguage": "en" }, + "searchBarConfig": {}, + "searchProviders": [ + { + "id": "search-provider/cesium-ion", + "type": "cesium-ion-search-provider", + "name": "translate#viewModels.searchLocations", + "flightDurationSeconds": 1.5, + "minCharacters": 3 + } + ], "helpContent": [ { "title": "translate#gettingstarted.title", diff --git a/yarn.lock b/yarn.lock index 47cc85ffe..cba922e33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10635,10 +10635,10 @@ terriajs-server@^4.0.0: request-promise "^4.0.1" yargs "^13.2.4" -terriajs@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/terriajs/-/terriajs-8.3.2.tgz#c98d734656b6e215917cc4c3cb62aab635ed0f8c" - integrity sha512-Hu/tbMOI2y6BcE3f77xFY+f3pnraddGZneqIBeS9JuWXlxjpiZ/dB1lORPM457ldvm39frm/IQff9YmclM8hfg== +terriajs@8.3.9: + version "8.3.9" + resolved "https://registry.yarnpkg.com/terriajs/-/terriajs-8.3.9.tgz#e4bee5c367c8ac10a6c8fa8bf35854e1abccc573" + integrity sha512-91Xnkp3BKUJFpjQXfdwonOZOri4RzTFGLtap8fNLI7GUzmTRsr3R/WaWlNrtYp5N4M3rJOsAKpoEIbROHHD9HA== dependencies: "@babel/core" "^7.22.9" "@babel/parser" "^7.22.7" @@ -10707,7 +10707,6 @@ terriajs@8.3.2: "@visx/tooltip" "^2.1.0" assimpjs "^0.0.7" babel-loader "^8.2.3" - babel-plugin-jsx-control-statements "^4.0.0" babel-plugin-lodash "^3.3.4" bottleneck "^2.19.5" catalog-converter "^0.0.9"