Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoJson vector-tile dynamic styling #5900

Merged
merged 27 commits into from
Nov 16, 2021
Merged

GeoJson vector-tile dynamic styling #5900

merged 27 commits into from
Nov 16, 2021

Conversation

nf-s
Copy link
Contributor

@nf-s nf-s commented Oct 10, 2021

What this PR does

  • GeoJsonMixin.style["stroke-opacity"] will now also set polygonStroke.alpha and polylineStroke.alpha (Specifying stroke-opacity for geojson polygons in init files does not work #5870)
  • Reduce GeoJsonMixin default stroke width from 2 to 1
  • Add TableMixin styling to GeoJsonMixin - it will treat geojson feature properties as "rows" in a table - which can be styled in the same way as TableMixin (eg CSV). This is only enabled for geojson-vt/Protomaps (which requires Terria.configParameters.enableGeojsonVt = true). For more info see GeojsonMixin.forceLoadMapItems()
    • This can be disabled using GeojsonTraits.disableTableStyle
  • Opacity and splitting is enabled for Geojson (if using geojson-vt/protomaps)
  • Replaced @types/geojson Geojson types with @turf/helpers
  • In GeojsonMixin replaced with customDataLoader, loadFromFile and loadFromUrl with forceLoadGeojsonData
  • GeojsonMixin will now convert all geojson objects to FeatureCollection
  • Exporting GeojsonMixin will now add proper file extensions
  • WebFeatureServiceCatalogItem and SocrataMapViewCatalogItem now uses GeoJsonMixin All Catalog items should use GeojsonMixin instead of creating GeoJsonCatalogItems #5380
  • Fix ProtomapsImageryProvider geojson feature picking over antimeridian
  • Add Socrata group to "Add web data"
  • Added "marker-stroke-width", "polyline-stroke-width", "polygon-stroke-width" to GeojsonStyleTraits (Note these are not apart of simplestyle-spec and can only be used with geojson-vt)

Test links

Warning some of the datasets are quite large, so may take a while to load

Pacificmap
http://ci.terria.io/vector-styling/#configUrl=https://raw.githubusercontent.com/TerriaJS/saas-catalogs-public/main/pacificmap/map-config/prod.json&share=s-zwoZq0MAbEny41Vmg6vrCEnUKlg

Nationalmap

http://ci.terria.io/vector-styling/#configUrl=https://nationalmap.gov.au/config.json&share=s-kLItCqL3Fe4aSVfBFAnCnpwoXqJ

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.

@nf-s nf-s changed the title geojson-vt-styling working GeoJson vector-tile dynamic styling Oct 21, 2021
@nf-s nf-s marked this pull request as ready for review October 26, 2021 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants