-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
🆕 FEATUREnew featurenew feature
Description
var geojson2svg = require('geojson2svg');
var converter = geojson2svg({
attributes: ['properties.foo', 'properties.bar', 'properties.baz']
});
var svgStr = converter.convert({
type: 'FeatureCollection',
features: [{
type: 'Feature',
geometry: {type: 'LineString', coordinates: [[0,0], [1000,1000]]},
properties: {foo: 'fooVal-1', bar: 'barVal-1', baz: 'bazVal-1'}
}, {
type: 'Feature',
geometry: {type: 'LineString', coordinates: [[10,10], [100,100]]},
properties: {foo: 'fooVal-2', bar: 'barVal-2'}
}]
});
console.log(svgStr);
/* output
[
'<path d="M128,128 128.00638801979818,127.99361198020182" foo="fooVal-1" bar="barVal-1" baz="bazVal-1"/>',
'<path d="M128.00006388019798,127.99993611980202 128.00063880197982,127.99936119802018" foo="fooVal-2" bar="barVal-2"/>'
]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🆕 FEATUREnew featurenew feature