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

Bounding box ordering, re-centering issues? #110

Closed
jywarren opened this issue Jan 8, 2019 · 10 comments · Fixed by #255
Closed

Bounding box ordering, re-centering issues? #110

jywarren opened this issue Jan 8, 2019 · 10 comments · Fixed by #255
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@jywarren
Copy link
Member

jywarren commented Jan 8, 2019

I opened the Wisconsin Non-Metal layer but then it tries to recenter on a very broad bounding box:

image

https://publiclab.org/people#12/43.9929/-90.3883/BL1-Wisconsin_NM

Wondering if there is some better ordering we need to do to manage how the re-zooming leaves things once all layers are loaded. Ideas?

@sagarpreet-chadha
Copy link
Collaborator

Okay , so what is happening is that LEL first re-centers to the correct bounding box according to the URL , but after few milliseconds plots2 re-centers to my personalized view bounding box according to my location OR if you have not shared location , the default is to set to zoom level 2 .

@sagarpreet-chadha
Copy link
Collaborator

  • We definitely should remove the default zooming to level 2 .
  • When we choose WisconsinLayer we are forcefully zoomed and panned . Lets remove this also !

After this , if you have not shared your location - then everything will work fine 👍 .

But if you have shared your location - it will show your location centeric bounding box AND not the correct one according to the URL . So to solve this , i was thinking showing a link below the map - "Show nearby things or something" , on clicking it show nearby view .

What do you think ?

@jywarren
Copy link
Member Author

jywarren commented Jan 10, 2019 via email

@grvsachdeva grvsachdeva added the help wanted Extra attention is needed label Jan 13, 2019
@jywarren
Copy link
Member Author

OK @sagarpreet-chadha can we start with stopping the layers from recentering, as a first step? Thank you!

Also, I can't seem to get links at zoom level 12 (or any higher than 7) to work when loading a new map. For example: https://publiclab.github.io/leaflet-environmental-layers/example/#12/44.3913/-91.0156/BL2-Wisconsin_NM-FT_mobile-Purple-STruth-windrose-AQI

This should open at zoom 12, but it opens at zoom 7. I think this is the same issue, maybe? I'd like to see this as the default view:

screen shot 2019-01-15 at 2 34 44 pm

@sagarpreet-chadha
Copy link
Collaborator

On it 👍 ! Yes happening due to same reason of implicit zooming of some layers causing url to work improperly .

@jywarren jywarren added the bug Something isn't working label Mar 8, 2019
@jywarren jywarren pinned this issue Mar 8, 2019
@jywarren jywarren changed the title Bounding box ordering issues? Bounding box ordering, re-centering issues? Mar 8, 2019
@avsingh999
Copy link
Member

@jywarren @sagarpreet-chadha we have to change all layers default zoom level 12. Am I right
thanks

@jywarren
Copy link
Member Author

Hi @ananyaarun @sagarpreet-chadha -- this will be an interesting one to try to work into the idea of standardized layers. In your new plan, does each layer have a kind of "info" properties, sort of like how each module in Image Sequencer does?

https://github.com/publiclab/image-sequencer/blob/2c58edfe9a8f201675d0d601e9771dbfa104c493/src/modules/Blur/info.json#L1-L15

One advantage here is that we can turn of auto-zooming (this may already be done?) but then we can make layers visible/hidden according to how they define their range of zooms and the extend of their data.

{
  name: 'Wisconsin Non-Metallic Mining',
  url: 'https://example.com/docs',
  extents: {
    minLat: 0,
    maxLat: 0,
    minLng: 0,
    maxLng: 0,
    minZoom: 2,
    maxZoom: 6
  }
}

Sorry if i'm not synced up with your latest planning but wanted to highlight how such a structure could help solve problems like these!

@jywarren
Copy link
Member Author

Link to #1 #198

@jywarren jywarren added this to the v1.0 milestone Jul 8, 2019
@sagarpreet-chadha
Copy link
Collaborator

Hi @jywarren ,

So following questions :

  1. Remove all autozooming and autopanning from LEL?

  2. In plots2, there is autozooming and autopanning based on your location, which we cannot use with Leaflet Hash .

  • What happens now is that the URL pans and zooms somewhere BUT after 3 seconds if location is shared then map zooms/pans to users locations . What to do here?

Thanks!

@jywarren
Copy link
Member Author

Remove all autozooming and autopanning from LEL?

I just meant those that are triggered by a layer. So if a layer loads, sometimes (like the Wisconsin layer) it tries to center the map on the newly shown data. Let's turn that off, because as someone turns on several layers, the map may zoom around as a result as the data comes in.

Does that bypass the issue with the 'share your location'? Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
4 participants