Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/TerriaJS/terriajs into rer3…
Browse files Browse the repository at this point in the history
…d_from_8.7.9
  • Loading branch information
glughi committed Nov 15, 2024
2 parents 500c26d + 1217b82 commit 5a8a89e
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### next release (8.7.9)

- Properly initialize react ref in functional components
- Add NominatimSearchProvider.
- [The next improvement]

#### 8.7.8 - 2024-11-01
Expand Down
24 changes: 24 additions & 0 deletions doc/customizing/search-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,30 @@ It can be configured using following options
}
```

### NominatimSearchProvider

`type: nominatim-search-provider`

Nominatim uses OpenStreetMap data to find locations on Earth.
It can be configured using following options

| Name | Required | Type | Default | Description |
| -------------- | -------- | ---------- | ----------- | ------------------------------------------------------------------------------------------- |
| `countryCodes` | no | **string** | `undefined` | A comma-separated list of country codes (ISO 3166-1alpha2) to prioritize the search results |
| `maxResults` | no | **number** | 5 | The maximum number of results to return |

**Example**

```json
{
"id": "search-provider/nominatim",
"type": "nominatim-search-provider",
"name": "Nominatim",
"flightDurationSeconds": 2,
"minCharacters": 3
}
```

### Implementing new location search provider

Implementing new location search provider is similar to implementing new `CatalogItems` and `CatalogGroups`. Each of them should be based on the usage of one of the mixins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export default class ThreddsItemReference extends UrlMixin(
);
if (model === undefined) return;
this.setThreddsStrata(model);
_previousTarget = model;
return model;
}
}
1 change: 0 additions & 1 deletion lib/Models/Catalog/Ckan/CkanItemReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ export default class CkanItemReference extends UrlMixin(
}

if (model === undefined) return;
_previousTarget = model;
await this.setCkanStrata(model);

model.setTrait(CommonStrata.definition, "name", this.name);
Expand Down
1 change: 0 additions & 1 deletion lib/Models/Catalog/Esri/ArcGisPortalItemReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ export default class ArcGisPortalItemReference extends AccessControlMixin(
);

if (model === undefined) return;
_previousTarget = model;
await this.setArcgisStrata(model);

const defintionStratum = this.strata.get(CommonStrata.definition);
Expand Down
4 changes: 2 additions & 2 deletions lib/ReactViews/Tools/ItemSearchTool/SearchResults.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { observer } from "mobx-react";
import Mustache from "mustache";
import React, { useState } from "react";
import React, { useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { useVirtual } from "react-virtual";
import styled from "styled-components";
Expand Down Expand Up @@ -28,7 +28,7 @@ const SearchResults: React.FC<SearchResultsProps> = (props) => {
currentMapEffect.is === "highlightSingleResult"
? currentMapEffect.result
: undefined;
const parentRef = React.createRef<HTMLDivElement>();
const parentRef = useRef<HTMLDivElement>(null);
const list = useVirtual({
size: results.length,
parentRef,
Expand Down
4 changes: 2 additions & 2 deletions lib/ReactViews/Tools/PedestrianMode/MouseTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { createRef, useEffect } from "react";
import React, { useEffect, useRef } from "react";
import styled from "styled-components";
import Cartesian2 from "terriajs-cesium/Source/Core/Cartesian2";
import Scene from "terriajs-cesium/Source/Scene/Scene";
Expand All @@ -11,7 +11,7 @@ type MouseTooltipProps = {

const MouseTooltip: React.FC<MouseTooltipProps> = (props) => {
const { scene, text } = props;
const tooltipText = createRef<typeof TooltipText>();
const tooltipText = useRef<typeof TooltipText>(null);

useEffect(function tooltipFollowMouse() {
const setTooltipPosition = (position: { x: number; y: number }) => {
Expand Down
6 changes: 5 additions & 1 deletion wwwroot/languages/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@
"carto-v3": "Carto V3",
"i3s": "I3S",
"esri-imageServer": "Esri ArcGIS ImageServer (capa única)",
"cesium-ion": "Cesium ion"
"cesium-ion": "Cesium ion",
"cog": "Geotiff optimitzat al núvol (COG)"
},
"printWindow": {
"errorTitle": "Error d'impressió",
Expand Down Expand Up @@ -2090,6 +2091,9 @@
"name": "Esri ArcGIS ImageServer",
"invalidUrlMessage": "No s'ha pogut carregar el punt final de l'ArcGis ImageServer perquè l'element del catàleg no té una \"url\".",
"invalidServiceMessage": "S'ha produït un error en invocar ArcGIS Image Service. La resposta del servidor no sembla ser un document Image Service vàlid."
},
"cogCatalogItem": {
"experimentalReprojectionWarning": "Aquest COG no es està en una projecció nativa (EPG:4326 o EPSG:3857). La reprojecció és experimental i pot ser que no funcioni com s'esperava. Si teniu el control de les dades d'origen, us recomanem que torneu a projectar a EPSG:4326 o EPSG:3857 mitjançant GDAL o similar."
}
},
"deltaTool": {
Expand Down
28 changes: 16 additions & 12 deletions wwwroot/languages/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
"expand": "Rozbalit",
"download": "Stáhnout",
"loading": "Načítání dat grafu...",
"noData": "Nebyla nalezena žádná data grafu.",
"noData": "Nenalezeny žádné údaje, které by bylo možné zobrazit v tabulce.",
"showItemInChart": "Zobrazit {{value}} v tabulce"
},
"viewModels": {
Expand Down Expand Up @@ -737,7 +737,8 @@
"carto-v3": "Carto V3",
"i3s": "I3S",
"esri-imageServer": "Esri ArcGIS ImageServer (jedna vrstva)",
"cesium-ion": "Ionty cesia"
"cesium-ion": "Ionty cesia",
"cog": "Geotiff optimalizovaný pro cloud"
},
"printWindow": {
"errorTitle": "Chyba tisku",
Expand Down Expand Up @@ -1404,7 +1405,7 @@
"missingUrlTitle": "Nelze načíst GetCapabilities",
"missingUrlMessage": "Nepodařilo se načíst dokument GetCapabilities služby WFS (Web Feature Service), protože položka katalogu nemá `url`.",
"noLayerFoundTitle": "Nenalezena žádná vrstva",
"noLayerFoundMessage": "WFS datová sada '{{name}}' nemá žádné vrstvy odpovídající '{{typeNames}}'. Buď byl soubor katalogu nastaven nesprávně, nebo se změnil server WFS.",
"noLayerFoundMessage": "Datová sada WFS '{{name}}' nemá žádné vrstvy odpovídající '{{typeNames}}'. {{suggested}} {{line}}{{line}}Buď byl katalogový soubor nastaven nesprávně, nebo se změnil server WFS.",
"reachedMaxFeatureLimit": "Varování: Tato vrstva dosáhla limitu funkcí WFS ({{maxFeatures}})"
},
"webMapServiceCatalogGroup": {
Expand Down Expand Up @@ -1673,7 +1674,7 @@
"start": {
"selectableDimensions": {
"start": {
"name": "Start"
"name": "Spustit"
},
"stop": {
"name": "Stop"
Expand Down Expand Up @@ -1811,16 +1812,16 @@
"range": "{{value1}} až {{value2}}",
"selectableDimensions": {
"remove": {
"value": "Odebrat"
"value": "Odstranit"
},
"start": {
"name": "Start"
"name": "Spustit"
},
"stop": {
"name": "Stop"
}
},
"noValue": "Bez hodnoty"
"noValue": "(Bez hodnoty)"
}
}
},
Expand All @@ -1829,7 +1830,7 @@
},
"styleType": {
"name": "Typ",
"undefinedLabel": "Upřesněte prosím",
"undefinedLabel": "Prosím upřesněte",
"constant": {
"name": "Bez stylu"
},
Expand All @@ -1843,13 +1844,13 @@
"enum": {
"selectableDimensions": {
"enum": {
"noValue": "Žádná hodnota",
"noValue": "(Bez hodnoty)",
"selectableDimensions": {
"value": {
"name": "Hodnota"
},
"remove": {
"value": "Odebrat"
"value": "Odstranit"
}
},
"add": {
Expand Down Expand Up @@ -2014,7 +2015,7 @@
"name": "Hodnota"
},
"remove": {
"value": "Odebrat"
"value": "Odstranit"
},
"add": {
"value": "Přidat barvu"
Expand Down Expand Up @@ -2089,6 +2090,9 @@
"invalidUrlMessage": "Nelze načíst koncový bod ArcGis ImageServer, protože položka katalogu nemá `url`.",
"invalidServiceTitle": "Neplatná služba ArcGIS Image Service",
"rasterFunction": "Rastrová funkce"
},
"cogCatalogItem": {
"experimentalReprojectionWarning": "Tento COG není v nativní projekci (EPSG:4326 nebo EPSG:3857). Reprojekce je experimentální a nemusí fungovat podle očekávání. Pokud máte kontrolu nad zdrojovými daty, doporučujeme reprojekci do EPSG:4326 nebo EPSG:3857 pomocí GDAL nebo podobného nástroje."
}
},
"deltaTool": {
Expand Down Expand Up @@ -2230,7 +2234,7 @@
"enabled": "Povoleno",
"disabled": "Vypnuto",
"colorAdd": "Přidat",
"colorRemove": "Odebrat",
"colorRemove": "Odstranit",
"invalid": "Neplatné"
}
}

0 comments on commit 5a8a89e

Please sign in to comment.