publicmap / electionmap

Electoral map tool
https://www.electionmap.in
MIT License
16 stars 10 forks source link

Center upon user click #24

Closed DaxServer closed 5 years ago

DaxServer commented 5 years ago

We can either

  1. Center the user clicked location
  2. Center the constituency, if we have access to the boundary geometry
batpad commented 5 years ago

@SrihariThalla nice catch :-)

I think centering the user clicked location is probably fine?

Hmm .. the alternative would be to zoomToExtent or so of the constituency boundary .. that miiight be really cool as well :-) - @planemad is it possible to get the geometry for the clicked on constituency boundary somewhere with the Tileserver API (or otherwise?) - will GL give this to use somewhere with .queryRenderedFeatures or so?

@SrihariThalla maybe we can center to user clicked location for now (since that should be relatively straightforward?) - and come back to zooming to constituency boundary? But also, if you feel like you have a good idea and handle on the zooming to constituency boundary, do go for it :)

planemad commented 5 years ago

Fitting the bounds of the clicked constituency would be perfect!

planemad commented 5 years ago

@SrihariThalla we can get the geometry of clicked constituency with https://github.com/publicmap/electionmap/issues/27#issuecomment-480599342

answerquest commented 5 years ago

Hi, sharing an experience from my routes mapping work : If you're mighty zoomed in (like, looking for a village that's supposed to be just down that river, and somewhere between those two hills) or mighty zoomed out (like, just wanting to compare between different constituencies of your state) then the auto-zoom can give a jarring experience and ruin one's orientation (esp if they have rotated the map and were "on to something". Reaction: "wtf I had arranged it perfectly why u changed it??" ).

I found this out the hard way when I asked the mappers I was working with; had to temper my fancy effects enthusiasm and change all my flyTo and fitBounds to panTo which is fine - simply moving the map to bring the focus point to center is fine. It would be nice to highlight the boundary and if the user then zooms out and notices the boundary was highlighted then they'll be like "awww how thoughtful!".

And I hate to bring this up again, but the fact that Mapbox-GL isn't quite the smoothest at moving around and esp at zooming in or out, might compound the jarring / disorientation effect.

CC @planemad @batpad

planemad commented 5 years ago

@answerquest useful insights from user testing. The expected experience from the user depends on what their workflow was while using the interface. This could have been different for the route mapping app that you mention.

For the PCs, one issue is the range of their sizes is fairly large, too much oom and you are in the middle of nowhere and too little might make the PC invisible.