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

DragNDrop and shapefiles #1206

Open
mbredif opened this issue Aug 21, 2019 · 2 comments
Open

DragNDrop and shapefiles #1206

mbredif opened this issue Aug 21, 2019 · 2 comments

Comments

@mbredif
Copy link
Collaborator

mbredif commented Aug 21, 2019

3 comments/issues related to my attempt to use DragNDrop plugin to load a zipped version of the velib dataset used in the shapefile example.

API mismatch

The APIs of DragNDrop and shapefileParser are not directly compatible, such that the following does not work :

DragNDrop.register('zip', DragNDrop.BINARY, itowns.ShapefileParser.parse, DragNDrop.COLOR);

A quick fix could be to have itowns.ShapefileParser.parse accept an argument of type ArrayBuffer containing the zip and call parseZip(data.zip || data) internally.

styling for point features

the default DragNDrop style does not display point feature, we could add to it :

                point: {
                    color: '#' + randomColor.toString(16),
                    line: '#' + randomColor.toString(16),
                }

style option

an optionnal style argument could be added to DragNDrop.register to override the style which is now limited to random colors. A similar request could be to override the convert function of geometry layers.

@zarov
Copy link
Contributor

zarov commented Aug 22, 2019

A quick fix could be to have itowns.ShapefileParser.parse accept an argument of type ArrayBuffer containing the zip and call parseZip(data.zip || data) internally

Yes, I let you do this quick patch !

the default DragNDrop style does not display point feature, we could add to it :

Yeah I didn't see that, thanks for noticing it. I let you do this too ;)

an optionnal style argument could be added to DragNDrop.register to override the style

I agree, maybe you can add a options as a last argument of register, and then at first you can put style into it, and convert can be added later.

@mgermerie
Copy link
Contributor

@ftoromanoff developed an update of DragNDrop plugin which adds a better support for shapefiles. It would need to be pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants