-
Notifications
You must be signed in to change notification settings - Fork 41
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
How to get viewPort of the result SVG? #35
Comments
@oyatek My apologies for late reply, by this time you would have solved your issue. Actually viewPort size is passed as parameter when you create the instance of GeoJSON2SVG: const {GeoJSON2SVG} = require('geojson2svg');
const converter = new GeoJSON2SVG({
mapExtent: {left: -180, bottom: -90, right: 180, top: 90},
viewportSize: {width: 200, height: 100},
attributes: ['properties.class' , 'properties.foo'],
r: 2
});`` |
Please reopen if issue is not resolved. |
I mean that for example I have geoJSON of New York City and I need to get the coordinates of the bounding box (lat/lng coords) of the whole area. GeoJSON has all coordinates so technically it should be possible to find min/max coordinates, right? But maybe not been implemented in the library yet. |
This feature is implemented, if parameter
If you put your example code, we can debug more. Please read about In case you require to calculate the data set extent, you can use https://www.npmjs.com/package/geojson-bbox |
Thank you very much! I will try the suggested solution. |
Sure, once your issue is resolved we'll close this issue. |
It seems the script just returns an array of SVG paths.
How to get the viewPort of the result SVG? (taken from geoJSON)?
The text was updated successfully, but these errors were encountered: