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

ready event on <Map> not firing anymore on 8.1.1 #56

Open
evdama opened this issue Jul 21, 2021 · 8 comments
Open

ready event on <Map> not firing anymore on 8.1.1 #56

evdama opened this issue Jul 21, 2021 · 8 comments

Comments

@evdama
Copy link

evdama commented Jul 21, 2021

I'm on Sapper 0.29.2 where I've worked on a map over the last few days using the following code where on:ready fired as expected:

              <Map
                accessToken=ROLLUP_MAPBOX_EDM_DEFAULT_PUBLIC_ACCESS_TOKEN
                bind:this={ mapComponent }
                bind:zoom
                on:click={ toggleStyle }
                on:ready={ () => console.log('inline ready event...') }
                on:dragend={ colorizeBuildings }
                on:dragend={ showUrbanAreas }
                on:zoomend={ colorizeBuildings }
                on:zoomend={ showUrbanAreas }
                on:zoomstart={ toggleStyle }
                options={{ attributionControl: false, antialias: true }}
                style = { $userStore.userCurrenMapBoxTheme }
              >
  1. However, after upgrading from 7.7.1 to 8.1.1 on:ready doesn't fire anymore i.e in the above snippet console.log() never prints to the console? 🤔
  2. What I also noticed just now is that bind:zoom stopped working i.e. using { zoom } somewhere on the page to show the user his current zoom level worked in 7.7.1 but stopped working after upgrading to version 8.1.1

@antony does on:ready work for you at this point i.e. using 8.1.1? I just went back to 7.7.1 and all works again, no change to my source, just downgrading svelte-mapbox 🤷‍♂️

@evdama evdama changed the title ready event on <Map> not firing anymore on v8 ready event on <Map> not firing anymore on 8.1.1 Jul 22, 2021
@antony
Copy link
Member

antony commented Jul 23, 2021

Hey @evdama - it's possible I broke some events, and it looks like, possibly broke the zoom binding.

I'll try to fix these issues asap.

@antony
Copy link
Member

antony commented Jul 23, 2021

Ok, I've fixed the events, not sure how to handle the bindings at all since it all lives inside an action now, and that means I can't do anything reactive. that needs some thought I guess.

I considered putting all the values in stores - so maybe I'll be able to do this sometime soon, but I don't have time right now.

@evdama
Copy link
Author

evdama commented Jul 23, 2021

@evdama
Copy link
Author

evdama commented Jul 24, 2021

Ok, I've fixed the events, not sure how to handle the bindings at all since it all lives inside an action now, and that means I can't do anything reactive. that needs some thought I guess.

Yes, ok, the Readme still mentions bindings i.e. somebody installing svelte-mapbox today would be very confused as it's not working as described.

I considered putting all the values in stores - so maybe I'll be able to do this sometime soon, but I don't have time right now.

Roger Roger... It's just really really nice if you can show reactively updated values to the user such as

<div class="flex flex-row justify-center">Your Current Zoom Level: { zoom }</div>

@antony
Copy link
Member

antony commented Jul 29, 2021

Yep - I'll have a think on this or wait for somebody smarter to come up with a solution!

@evdama
Copy link
Author

evdama commented Aug 5, 2021

@antony What do you think about having dragstart like mentioned above?

@antony
Copy link
Member

antony commented Nov 1, 2021

@evdama If it's useful, then yeah I think dragstart would be a useful event.

@jesi-rgb
Copy link

just boosting this here, as in mapbox ^9.1.0 the zoom and center bindings still do not work :(

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

No branches or pull requests

3 participants