publicmap / electionmap

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

If user location is outside India, default to some center-point #23

Closed batpad closed 5 years ago

batpad commented 5 years ago

Right now, if someone is checking the site from outside the country, it will jump to their location, wherever it maybe.

We should:

Let me know if this might be something someone might be able to / willing to take on? Happy to support / outline better what needs to be done and where :)

cc @SrihariThalla

DaxServer commented 5 years ago

Instead of defining the BBOX ourselves, how about reverse geocoding the location and check if it is India or not and proceed from there?

It's rather more accurate and no manual work ;)

On Sun, Apr 7, 2019, 12:59 Sanjay Bhangar notifications@github.com wrote:

Right now, if someone is checking the site from outside the country, it will jump to their location, wherever it maybe.

We should:

  • Define a BBOX bounds that roughly encompasses the Indian subcontinent
  • Check if the users location falls inside of it
  • If not, DON'T zoom to user location, just remain at zoomed out map of India

Let me know if this might be something someone might be able to / willing to take on? Happy to support / outline better what needs to be done and where :)

cc @SrihariThalla https://github.com/SrihariThalla

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publicmap/electionmap/issues/23, or mute the thread https://github.com/notifications/unsubscribe-auth/AHIigTYl-U9WWeH0Fn0QmZ20FoD-FzzTks5veZ5TgaJpZM4cgm9X .

batpad commented 5 years ago

There maybe a simpler fix yet :-) - can probably just define a maxBounds on the map or so. I can look into this. I'd rather avoid another network request / dependency on a geocoding service for this - like we shouldn't affect performance for 99% of our users (from India) - for this edge case - just restricting the map to some reasonable bounds should prevent the case of someone being shown a zoomed in map of some foreign place where they are and being not sure how this is supposed to work :-)

batpad commented 5 years ago

Duh - there's already a maxBounds on the map 🤦‍♂️ thanks @planemad - I think that's enough and we should not worry about this. Apologies for opening this issue :-)