klpdotorg / dise_dashboard

Dashboard for Dise data to allow interactive dise data gathering
2 stars 4 forks source link

Zoom issue #89

Closed iambibhas closed 10 years ago

iambibhas commented 10 years ago

@geohacker The zoom issue seems to originate wherever I use map.panTo(). https://github.com/klpdotorg/dise_dashboard/blob/bibhas/assets/static/js/dise.js#L691 and https://github.com/klpdotorg/dise_dashboard/blob/bibhas/assets/static/js/dise.js#L725

I just need a way to bring the provided FeatureCollection to the view just the first time. After that moving around shouldn't effect the zooming. Any other way you can think of?

I thought of checking if the provided geojson coordinates are inside current bbox and pan if not. But can't seem to find a way to do that with leaflet.

geohacker commented 10 years ago

Hmm. That is strange. Problem is, I can't reproduce the bug consistently. Do you think this https://github.com/klpdotorg/dise_dashboard/blob/bibhas/assets/static/js/dise.js#L623-L626 might be an issue?

geohacker commented 10 years ago

Also, have you set filtersEnabled=true before panning?

iambibhas commented 10 years ago

Yeah. Also, we need to update the bbox on the url whenever the user moves around the map. So that block should be like that. We need to decide whether to pan or not pan within the handleHashChange() function. Right now, if you pan, hash changes, and the map.panTo gets called and the map moves itself and centers to the middle point.

BTW, although the map has been moved to the left side of the window, it seems leaflet still thinks that the center of the window is the center of the map. Any reason you can think of why this is happening?

geohacker commented 10 years ago

You are right. The map is behaving strange. @prtksxna where are you fixing the width of the map?

geohacker commented 10 years ago

@prtksxna the map and controls must be a two column layout. It is not currently. the map takes width:100% which is strange. There's a z-index:9999 on the controls div which is not required. Can you please take a look at this soon? We are trying to debug the map zoom issues and can happen only after this is fixed.

geohacker commented 10 years ago

Also, why this? https://github.com/klpdotorg/dise_dashboard/blob/dev/assets/static/js/ui.js#L37-L54

geohacker commented 10 years ago

Plus, if you are changing the size of the map then this has to be invoked so that leaflet knows the new size - http://leafletjs.com/reference.html#map-invalidatesize

iambibhas commented 10 years ago

I'll try invoking invalidation and see if it works. On Feb 12, 2014 4:53 PM, "Sajjad Anwar" notifications@github.com wrote:

Plus, if you are changing the size of the map then this has to be invoked so that leaflet knows the new size - http://leafletjs.com/reference.html#map-invalidatesize

Reply to this email directly or view it on GitHubhttps://github.com/klpdotorg/dise_dashboard/issues/89#issuecomment-34859791 .

geohacker commented 10 years ago

Prateek and I discussing this in the channel. Wait for us to post the results here.

On Wed, Feb 12, 2014 at 6:29 PM, Bibhas notifications@github.com wrote:

I'll try invoking invalidation and see if it works. On Feb 12, 2014 4:53 PM, "Sajjad Anwar" notifications@github.com wrote:

Plus, if you are changing the size of the map then this has to be invoked so that leaflet knows the new size - http://leafletjs.com/reference.html#map-invalidatesize

Reply to this email directly or view it on GitHub< https://github.com/klpdotorg/dise_dashboard/issues/89#issuecomment-34859791

.

Reply to this email directly or view it on GitHubhttps://github.com/klpdotorg/dise_dashboard/issues/89#issuecomment-34866157 .

Sajjad Anwar | W: http://sajjad.in | T: @geohacker