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

Precision examples #13

Closed

Conversation

mridulnagpal
Copy link
Member

#10 Moved code to blurredLocationDisplay src instead of index.html. Now we need a mechanism to show just those markers with specific precisions

@ghost ghost assigned mridulnagpal Aug 8, 2018
@ghost ghost added the in progress label Aug 8, 2018

console.log(options.blurredLocation.getPrecision());
var markers = {
marker_1: [1.5, 10.7, 0],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, actually these could stay in the example index.html code -- we just need to display them only at a range of zoom levels corresponding to their precision. So if they're x.x precision, we can use this guide to decide what zoom levels they should be shown for!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, if we're zoomed in so that the grid squares represent x.xx precision, we would NOT show markers with only x.x precision. But we WOULD show markers with x.xx precision or better. Make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have to bind them to the setZoom function right? Also where do you think we should store the markers, as once we need their objects to remove them. And we will have to remove them once the user zooms in to a greater precision.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jywarren Any comments?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @mridulnagpal -- yes, we should create a listener on setZoom, and I think we should hide them, but not delete them. Does that make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jywarren Yes, got it!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jywarren Just checked the hide option for layers is under construction, for now we can keep an array of location and when setZoom is called we remove all the markers and add the markers with correct precision, sounds good?

@jywarren
Copy link
Member

jywarren commented Aug 16, 2018 via email

@mridulnagpal
Copy link
Member Author

If we start fresh whenever the precision changes, there is no scope of leak of information, also there would be one list having all the locations which will be unchanged. We will just be displaying items which are of correct precision. It would be slower as compared to removing the some markers but safer.

@jywarren
Copy link
Member

jywarren commented Aug 16, 2018 via email

@mridulnagpal
Copy link
Member Author

Cool, will do some more research to check if hiding layers is available in leaflet.

@jywarren
Copy link
Member

jywarren commented Aug 16, 2018 via email

@mridulnagpal
Copy link
Member Author

Hi @jywarren I looked at the documentation, it seems there is a hide function but it only hides one base layer in the control. We need to hide multiple layers on the map. What do you suggest, should we try with removeLayer?

@jywarren jywarren closed this Feb 6, 2019
@jywarren
Copy link
Member

jywarren commented Feb 6, 2019

We're going to solve this with the filter() concept in #20 -- thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants