Improve name fallback for GeoJSON
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 32
Description
We have files that are generated with empty title and descriptions, but a filled key called `country-name`.
Eg:
```
"properties": {
"title": "",
"description": "",
"country-name": "North Carolina",
"two-letter-code": "NC",
"fill": "#f0a3FF",
"fill-opacity": "0.5
},
```
The GeoJsonDataSource file loops through and attempts to figure out what name property to use. If `country-name` comes before title, it uses that, but if it comes after it assumes title, which is empty.
Current behavior:
* title second, filled : country-name first, filled: uses title [countryNameFirstTitleFilled.json](https://github.com/CesiumGS/cesium/files/13396842/countryNameFirstTitleFilled.json)
* title first, filled : country-name second, filled: uses title [countryNameFirstTitleEmpty.json](https://github.com/CesiumGS/cesium/files/13396841/countryNameFirstTitleEmpty.json)
* title first, empty : country-name second, filled: uses title [titleFirstEmptyCountryNameSecond.json](https://github.com/CesiumGS/cesium/files/13396840/titleFirstEmptyCountryNameSecond.json)
* title second, empty : country-name first, filled: uses country-name
https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/DataSources/GeoJsonDataSource.js#L151C11-L164
Is it possible/would it be ok to add an additional check to:
* Check if value of key is empty and if so, check the next key.
The preferred behavior is to show `x-name` even if it shows up after an empty title but only if the title is empty.
Contributor guide
Assessment
This issue has not been assessed yet.