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

Odd marker/cluster behavior when international date line is in view #24

Open
WillBrubaker opened this issue Aug 22, 2018 · 1 comment
Open

Comments

@WillBrubaker
Copy link

I couldn't see where this has been reported, perhaps it's expected behavior but anyhow...subject line pretty much says it all but here's a visual reference http://cld.wthms.co/DSxKuP

@vitorhugods
Copy link

I'll ressurect this issue and say that I didn't find any problem with this library regarding the international date line.

I had a similar issue, but fault was mine:
When camera moves, I get the the mapView's northEast and southWest to fetch data
Usually, northEast has values bigger than southWest, example:

  • SW(Lat = -1,Lng = -1)
  • NE(Lat = 1 ,Lng = 1)

If you query that on a database, using NE as max values, and SW as min values, it will work.

BUT, around the International Date Line, this is not true, example:

  • SW(Lat = -20, Lng = 170)
  • NE(Lat = 20, Lng = -170).

Notice that the SW Lng has a bigger value than NE Lng.

If you were to use the same query with this in a database, nothing would come out, because no Latitude can be bigger than 170 and smaller than -170 at the same time.

You could reverse them. Making bigger than -170 and smaller than 170. But by doing this you would get all points that are OUTSIDE the map viewport.

You either would need to: invert the query when the above happens, or split in two queries.

  • bigger than 170, smaller than 180. (gets the part in the left side of the line)
  • bigger than -180, smaller than -170. (gets the part in the right side of the line)

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

2 participants