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

create alert polygon layers with geojson2svg #68

Open
ephcoding opened this issue Aug 23, 2022 · 0 comments
Open

create alert polygon layers with geojson2svg #68

ephcoding opened this issue Aug 23, 2022 · 0 comments
Labels
🆕 FEATURE new feature

Comments

@ephcoding
Copy link
Member

ephcoding commented Aug 23, 2022

geojson2svg

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"/>'
]
@ephcoding ephcoding added this to the MVP: 22AUG27 milestone Aug 23, 2022
@ephcoding ephcoding removed this from the MVP: 22AUG27 milestone Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 FEATURE new feature
Projects
None yet
Development

No branches or pull requests

1 participant