-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Latitude or longitude out of range results in display of blank map #38
Comments
I can replicate locally by downloading this DB: https://git-history-demos.datasette.io/ca-fires.db |
After messing around with
Bounds in question for that first page load are: {
"_southWest": {
"lat": 32.578481,
"lng": -1191414610
},
"_northEast": {
"lat": 41.927772,
"lng": -115.917099
}
} |
It's definitely a bounds issue. Here are bounds that DO work, copied from a page that displays correctly: theMap.fitBounds([
[41.86889,-116.9075],
[32.75277778,-123.88658]
]) Running that on the empty map page that is meant to be showing 250 items zooms into California and makes the items visible. |
Looking closer at the bad bounds example shows what's happening:
That Longitude is missing its decimal point! So there's a corrupt record in this database which causes the map to fail to load. |
One easy fix would be to not attempt to include a marker for any locations where the latitude or longitude are outside of normal -90 < latitude < 90 and -180 < longitude < 180 limits |
https://git-history-demos.datasette.io/ca-fires/incidents
This SQL query also fails to load markers: https://git-history-demos.datasette.io/ca-fires?sql=select+Latitude%2C+Longitude+from+incident+order+by+_id+limit+101
But... if I add some filters, e.g. this one https://git-history-demos.datasette.io/ca-fires/incident?_sort=_id&_facet=ArchiveYear&ArchiveYear__exact=2020 - the map works.
The text was updated successfully, but these errors were encountered: