Registry / serialization / geostyler-style

geostyler-style

JSON →
library12.0.0jsnpmunverified

A TypeScript declaration file and utility library defining the geostyler-style format, an exchange format for representing geographic styles that can be translated between SLD, OpenLayers, Mapbox, CartoCSS and other standards. Current stable version is 12.0.0, released April 2026. The package ships TypeScript types and includes type guards for runtime type checking. It is developed as part of GeoStyler project, which provides UI components for building styles. Key differentiator: designed as an interchange format rather than a new styling standard, capable of capturing capabilities of multiple style formats while remaining human-readable.

npm install geostyler-style
INSTALL
IMPORT
SIG · GEOSTYLER-STYLE
G
geostyler-style
serializationjavascriptv12.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Styler
import { Styler } from 'geostyler-style'
import Styler from 'geostyler-style'
Styler is a named export, not default. Use named import.
Symbolizer
import { Symbolizer } from 'geostyler-style'
const { Symbolizer } = require('geostyler-style')
Package is ESM-only since v11. CJS require will fail.
isFilter
import { isFilter } from 'geostyler-style'
import { isFilter } from 'geostyler-style/dist/typeguards'
Since v12.0.0, typeguards are re-exported from main entry; using dist/ path works but is unofficial.

Creates a minimal GeoStyler style with a point mark symbolizer and uses the isSymbolizer type guard.

import { Styler, Style, Rule, Symbolizer, Expression, isSymbolizer } from 'geostyler-style' const pointStyle: Style = { name: 'My Point Style', rules: [{ name: 'Rule 1', symbolizers: [{ kind: 'Mark', wellKnownName: 'Circle', color: '#FF0000', radius: 6 }] }] } // Use type guard to check symbolizer kind if (pointStyle.rules[0].symbolizers[0].kind === 'Mark') { console.log(isSymbolizer(pointStyle.rules[0].symbolizers[0])); // true }
Debug
Known issues
breakingExpression type extended to support 'geometry' parameter; GeoStylerUnknownFunction extended with Fcustom functions.
fix
If you define custom functions, ensure they conform to the updated GeoStylerUnknownFunction type. For expressions using 'geometry', update type annotations accordingly.
affects: >=12.0.0
breakingPackage structure changed in v10.2.0 and reverted in v11.0.0; imports from dist/ paths may break.
fix
Use direct imports like 'geostyler-style' instead of 'geostyler-style/dist/...'. If you had imports referencing dist/ for v10.2.0–10.5.0, remove the dist/ path segment.
affects: >=10.2.0 <11.0.0
breakingPackage now ESM-only; CJS require will throw error.
fix
Switch from require() to import statements. If you must use CJS, use dynamic import(): const { Styler } = await import('geostyler-style')
affects: >=11.0.0
deprecatedImporting from 'geostyler-style/dist/typeguards' is deprecated; re-exports from main entry exist since v12.0.0.
fix
Change import to 'geostyler-style' directly. For example: import { isFilter } from 'geostyler-style'
affects: >=12.0.0
Errors
Common errors & fixes
Cannot find module 'geostyler-style' or its corresponding type declarations.
Missing installation or missing TypeScript types.
fix
Run npm install geostyler-style@12.0.0. Ensure tsconfig.json includes "node" in compilerOptions.types or "esModuleInterop": true.
Module not found: Can't resolve 'geostyler-style/dist/typeguards'
Importing from internal dist/ path which may have moved.
fix
Change import to 'geostyler-style' (typeguards are re-exported in v12+).
Upgrade
Version history
12.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
37 hits · last 30 days
node
32
OpenAI (training)
1
Resources
geostyler-style — npm install geostyler-style · libregistry