You can control which GeoJSON properties are attached to the resulting SVG elements using the attributes option. This can be passed to the constructor or the .convert() method.
1. Simple Property Mapping
Pass an array of strings representing property paths. The last part of the path is used as the SVG attribute name.
// If feature.properties.name = 'Park'
attributes: ['properties.name']
// Result: <path name="Park" ... />
2. Advanced Mapping (Static and Dynamic)
Pass an array of objects to define complex rules:
type: 'static': Always uses the provided value.type: 'dynamic': Extracts a value from the feature using a property path.
attributes: [
{ type: 'static', property: 'class', value: 'land-mass' },
{ type: 'dynamic', property: 'properties.pop_density', key: 'density' }
]
// Result: <path class="land-mass" density="[value]" ... />