Migration guide v13.0.0
This is the migration guide for version 13.
If you see the long list of breaking changes you might be scared of what you all have to change if you use the GeoStyler UI. But in most cases you wont have to do much as the breaking changes also consider changes made to subcomponets which most of the users don't actually use.
Most of you will use the <Style />
component. With version 13 and the new GeoStylerContext
you're able to customize a lot of the sub components without the need of stacking them together by yourself. But as this removes a lot of (passThrough) properties from the react components the list of breaking changes becomes quite long.
As the <GeoStylerContext />
is the most essential change in the new release you should have look at its documentation:
https://geostyler.github.io/geostyler/latest/index.html#/GeoStylerContext.
Now lets see what you actually have to adapt.
Previously the GeoStylerLocale
was merged with the antd locale and had to be used with the antd ConfigProvider
. Version >13 will not merge these two locales together but you will have to wrap your GeoStyler components with the GeoStylerContext like this:
import { GeoStylerContext, locale } from 'geostyler';
…
<GeoStylerContext.Provider
value={{
locale: locale.de_DE,
}}
>
…
</GeoStylerContext.Provider>
The following props have been modified or removed from the <Style /> component:
Modified/Removed property | Substition |
---|---|
locale |
Moved to GeoStylerContext.locale
|
data |
Moved to GeoStylerContext.data
|
compact |
Removed as the non-compact layout was removed from GeoStyler. You may want to have a look at CardStyle |
enableClassification |
inverted to disableClassification
|
dataProjection |
🔜 Will be moved to GeoStylerContext.composition.PreviewMap
|
filterUiProps |
🔜 Will be moved to GeoStylerContext.composition.FilterTree
|
ruleNameProps |
Removed as the non-compact layout was removed from GeoStyler. |
ruleTableProps |
Moved to GeoStylerContext.composition.Rules
|
ruleRendererType |
Moved to GeoStylerContext.composition.Renderer.rendererType
|
sldRendererProps |
Moved to GeoStylerContext.composition.SLDRenderer
|
iconLibraries |
Moved to GeoStylerContext.composition.IconEditor.iconLibraries
|
showAmountColumn |
Moved to GeoStylerContext.composition.Rule.amountField.visbility
|
showDuplicatesColumn |
Moved to GeoStylerContext.composition.Rule.duplicateField.visbility
|
colorRamps |
Moved to GeoStylerContext.composition.RuleGenerator.colorRamps
|
colorSpaces |
Moved to GeoStylerContext.composition.RuleGenerator.colorSpaces
|
useBrewerColorRamps |
Moved to GeoStylerContext.composition.RuleGenerator.useBrewerColorRamps
|
These older contexts and providers have been removed and merged into the GeoStylerContext
The browser version of the GeoStyler is now created with vite instead of WebPack. The new browser build can be found under node_modules/geostyler/browser/geostyler.js.iife.js
.