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

Add dropdown to change the type of a layer #738

Open
doskabouter opened this issue Sep 29, 2020 · 8 comments
Open

Add dropdown to change the type of a layer #738

doskabouter opened this issue Sep 29, 2020 · 8 comments

Comments

@doskabouter
Copy link

Maputnik version 1.7.0
Latest firefox on windows

Click to select any layer, there's no dropdown anymore next to the "type" field of the layer

@pathmapper pathmapper changed the title Impossible to change the type of a layer Add dropdown to change the type of a layer Oct 4, 2020
@pathmapper
Copy link
Contributor

@doskabouter thanks for bringing this up.

Currently it's possible to change the type of a layer using the JSON Editor:

change_layer_type

The different layer types are having different properties, so depending on the properties used it could be that switching a layer type leads to a bunch of errors.

I think there is no dropdown for historic reasons because in the past we didn't have a way to have a partially invalid style.

But now it should be possible to add the dropdown for layer type. I would find this useful especially for cases where you've just added a layer and selected the wrong type in the Add Layer modal and want to switch to the wanted type.

@doskabouter
Copy link
Author

Thanks for the response, changing it in the json is ofcourse a possibiity.
Re no dropdown: I'm reasonably sure I saw one in one of the previous versions...

@pathmapper
Copy link
Contributor

I'm reasonably sure I saw one in one of the previous versions...

@doskabouter ohh, you're right. It was available in v1.6.1 and older releases:
https://maputnik.github.io/releases/v1.6.1/

@orangemug was this removed intentional?

@chau-intl
Copy link

As it does make sense to be able to change the layer type it would be nice if it could be re-introduced.

I used to use this feature too in one of the previous versions and our users are really confused about it being missing since they like to use Maputnik because it provides a UI instead of having to write JSON code.

@orangemug
Copy link
Collaborator

Changing a type makes some (most??) of the properties of the previous layer type invalid. For example changing from a circle to a line makes everything except the common properties invalid in the new layer type, circle-color doesn't work with a line layer.

@chau-intl what does the user expect the app to do in this situation?

Also @chau-intl if you have time can you comment in #164 and tell us what you're up to with Maputnik?

@pathmapper
Copy link
Contributor

what does the user expect the app to do in this situation?

Maybe keep the common properties and use default values according to the style spec for the others?

@chau-intl
Copy link

@orangemug, well changing the type of course implies that a lot of settings might become irrelevant and I guess the user is okay with them being reset. I think what @pathmapper suggests above would be the expected result.

@orangemug
Copy link
Collaborator

@chau-intl yeah true I guess we do have an undo stack as well so they can always revert the change.

Yeah I'm happy with that as an approach.

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