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

Get current rectangle coordinates . #19

Open
sagarpreet-chadha opened this issue Feb 5, 2019 · 0 comments
Open

Get current rectangle coordinates . #19

sagarpreet-chadha opened this issue Feb 5, 2019 · 0 comments

Comments

@sagarpreet-chadha
Copy link
Collaborator

In LBL , we know the interval between grid for different zoom levels .

screenshot 2019-02-05 at 4 38 36 pm

From leaflet we can calculate centre of map and get coordinates .

BlurredLocation.map.getCenter() ;

Using the interval and centre coordinate => we can calculate the current rectangle .

STEPS :

  • Truncate the centre coordinate according to current interval (between grid coordinates [see pic above]) .
  • This truncated coordinate is the bottom-left coordinate .
  • Adding/subtracting 10 ^ (-1*interval) to it , all 4 coordinates can be achieved .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant