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

"minimal" mode #123

Closed
jywarren opened this issue Feb 27, 2019 · 17 comments · Fixed by #356
Closed

"minimal" mode #123

jywarren opened this issue Feb 27, 2019 · 17 comments · Fixed by #356
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jywarren
Copy link
Member

We should make it possible to show lots of layers in a minimal mode with small dots you can click on, kind of like these screenshots:

image

image

We could color them differently, and it could allow us to show more layers if we wanted to. They could be colored based on the listing shown in this mockup: #60 (comment)

Once this mode is off, we could re-show the larger icons for everything!

@avsingh999
Copy link
Member

@jywarren @gauravano can you explain more?
thank you : )

@jywarren
Copy link
Member Author

jywarren commented Mar 5, 2019

Basically looking for a way to turn all the markers into smaller, standardized "dots" of different colors, rather than their full icons. So that we can show more layers without filling up the screen!

@avsingh999
Copy link
Member

Okay, we will have to change all layer Icon into small dots. Am I right or not @jywarren .
Thank you : )

@jywarren
Copy link
Member Author

jywarren commented Mar 5, 2019 via email

@avsingh999
Copy link
Member

@jywarren I want to try to solve this issue.

@jywarren
Copy link
Member Author

jywarren commented Mar 6, 2019 via email

@rkpattnaik780
Copy link
Collaborator

@jywarren what about using a floating action button to toggle between marker icons and dots?

@jywarren
Copy link
Member Author

jywarren commented Mar 25, 2019 via email

@crisner
Copy link
Contributor

crisner commented Jan 14, 2020

After looking at different ways of doing this, I think we can use leaflet's circle marker to simplify layer markers and render them on canvas instead of creating separate DOM elements for each marker to improve performance. I tried this out in EonetFiresLayer and this is how it looks:
127 0 0 1_5500_example_index html (7)

I am planning to match the styling to the ones shown in the first comment to give it a more 'standardized' look. From what I see we will have edit each layer to conditionally choose the right marker depending upon the mode but would try to check if there is a better way of doing this.

@jywarren and @sagarpreet-chadha, what do you think?

@jywarren
Copy link
Member Author

jywarren commented Jan 14, 2020 via email

@crisner
Copy link
Contributor

crisner commented Jan 14, 2020

Thanks! Any cons I should be aware of when using canvas for rendering markers? What kind of issues did you have? I looked at glify but it looked like it takes in only geojson data.

@sagarpreet-chadha
Copy link
Collaborator

Hey,

So fetching markers icon from some external URL will take time.
Using L.circle i think will remove this latency.

I have one quick question, why do you want to use Canvas?

@crisner
Copy link
Contributor

crisner commented Jan 14, 2020

So fetching markers icon from some external URL will take time.
Using L.circle i think will remove this latency.

You are right. That's why I decided to go with L.circleMarker.

I have one quick question, why do you want to use Canvas?

Well, since we do not have a lot of markers in layers other than open sense and air quality index this may be redundant. I was hoping to reduce the page lag because of the number of marker elements in the dom in case the user turns on multiple layers and especially if one of those layers turn out to be layers like air quality index. What do you think? Should we deal with performance issues as a separate issue?

@sagarpreet-chadha
Copy link
Collaborator

Okay yes makes sense.
Can you try using L.circle for heavy layers and see if this still lags? (I am hoping this should not lag!)

Otherwise if it lags, then it makes sense to invest time in Canvas. Thanks!

@crisner
Copy link
Contributor

crisner commented Jan 14, 2020

Awesome. By the way, just to be clear, according to the docs L.circle is an obsolete way to instantiate circles. So, I will be using L.circleMarker which extends path and instantiates a circle marker.

@publiclab publiclab deleted a comment from sagarpreet-chadha Jan 15, 2020
@jywarren
Copy link
Member Author

I found that after 500-1000 markers, DOM markers slowed down a lot on slower devices. I had to actually modify glify (and had meant to submit the changes upstream, need to make a todo for this) because there's some complexity to how to determine which points to send a "click" to when someone clicks on a canvas. I think it's a clustering algorithm... thing. I fixed it in the library but it hurt my brain a bit. I think if you use a standard library it should be OK, and this should be handled for you!

@crisner
Copy link
Contributor

crisner commented Jan 17, 2020

Yes, I was expecting to have issues on clicks when I tried it out but it was handled in leaflet. Worked just like regular markers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants