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

Idea: use LControlLayers, lControlZoom other place than direct child #471

Open
paparent opened this issue Nov 11, 2019 · 2 comments
Open
Labels
confirmed Issue is accepted as either a bug or a valid enhancement enhancement help wanted

Comments

@paparent
Copy link

Hi!

This is more an idea. I use the map in multiple place in my application, and I have to setup the basic stuff over and over. Fortunately, the LTileLayer can be anywhere (since it uses the findReadParent). It's the most complicated to configure over and over..

But LControlZoom / LControlLayers for example need to be direct children of LMap.

I have a custom component that I would like to do something like:

<template>
  <div>
     <l-control-zoom position="topright" />
     <l-control-layers position="bottomright" />
     <l-tile-layer ..../>
  </div>
</template>

thanks!

@justinbeatz
Copy link

I have the same issue where I have some controls on a custom toolbar and have functions that needs to interact with the map object splitted in different components, for a workaround I'm using a global event bus and pass the map as payload, but I would like to know if there is a better way for doing that. I found this project that uses vuex https://github.com/webdev-cals-arizona-edu/vueaflet maybe that could be a better solution. I would like to hear suggestions.

@DonNicoJs
Copy link
Member

@paparent @justinbeatz This is a nice improvement, at the moment our efforts are towards the vue3 port but I will keep this in mind, in the meantime for DRY efforts maybe a mixin or a factory can help you :)

@DonNicoJs DonNicoJs added enhancement help wanted confirmed Issue is accepted as either a bug or a valid enhancement labels Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue is accepted as either a bug or a valid enhancement enhancement help wanted
Projects
None yet
Development

No branches or pull requests

3 participants