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

Map markers for nodes only appear after map interaction, not on initial load #6910

Closed
jywarren opened this issue Dec 4, 2019 · 7 comments · Fixed by #7343
Closed

Map markers for nodes only appear after map interaction, not on initial load #6910

jywarren opened this issue Dec 4, 2019 · 7 comments · Fixed by #7343
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript

Comments

@jywarren
Copy link
Member

jywarren commented Dec 4, 2019

Pages like https://publiclab.org/wiki/sandbox-3 show off the great new features of inline maps, but I noticed that the map markers for content (pages on PL) don't appear on initial load; only after interacting with the map a bit:

Initial load (no black map markers):

image

After dragging map:

image

I want to guess that the trigger for loading the remote API call for that layer is not triggered on initial page load, only on map move. Or if it is, it's getting missed perhaps due to load order?

@sagarpreet-chadha would you mind taking a look here to see if we can adjust this? Thank you!

@jywarren jywarren added bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript labels Dec 4, 2019
@jywarren jywarren added this to the Geographic features milestone Dec 4, 2019
@sagarpreet-chadha
Copy link
Contributor

sagarpreet-chadha commented Dec 5, 2019 via email

@jywarren
Copy link
Member Author

jywarren commented Dec 5, 2019 via email

@jywarren
Copy link
Member Author

jywarren commented Jan 7, 2020

@sagarpreet-chadha @nstjean if you happen to put an eye on this that would be great! I bet it's a one-liner to trigger the markers and we just forgot to do an initial page-load trigger.

@nstjean
Copy link
Contributor

nstjean commented Jan 7, 2020

Sure! I bet that's exactly what the issue is. @sagarpreet-chadha you said you had figured it out?

@jywarren
Copy link
Member Author

Just noting here - possible additional issue which we believe is solved, but linking:

@jywarren
Copy link
Member Author

I think i found the event handlers:

if(typeof mainLayer !== "undefined" && mainLayer !== ""){
if(mainLayer === "people"){
map.on('zoomend' , function () {
peopleLayerParser(map, markers_hash);
}) ;
map.on('moveend' , function () {
peopleLayerParser(map, markers_hash);
}) ;
}
else if(mainLayer === "content"){
map.on('zoomend' , function () {
contentLayerParser(map, markers_hash);
}) ;
map.on('moveend' , function () {
contentLayerParser(map, markers_hash);
}) ;
}
else { // it is a tagname
map.on('zoomend' , function () {
contentLayerParser(map, markers_hash, mainLayer);
}) ;
map.on('moveend' , function () {
contentLayerParser(map, markers_hash, mainLayer);
}) ;
}
}

@nstjean
Copy link
Contributor

nstjean commented Jan 24, 2020

I can fix this, I had to do something similar on /map/. I'll make a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants