Map display issues

Please fill out the following sections to the best of your ability, it will help us investigate bugs if we have this information at the outset. Screenshots are especially helpful, so please provide those if you can.

Platform: Website

Browser: Chrome Version 92.0.4515.159 (Official Build) (64-bit)

I’ve recently come across a number of problems with how the maps display on various parts of iNat. They are only minor issues that don’t affect me too much, but I thought it was worth bringing them up here. They don’t appear to be related to each other and I can only successfully replicate two of them:

Problem #1: The furthest map zoom level on individual observations does not show other observations.
This occurs with every single observation I look at - the other sightings of the taxon in question all show up in the map except at the furthest zoom level. E.g. for a typical sighting, at the second-furthest zoom level, all other observations are shown as you would expect:
image
But then at the furthest zoom level, they all disappear for some reason:
image
It’s not really a huge issue but every time I zoom out to see where a species has been sighted, I’m always disappointed that I have to drag to view the whole map rather than being able to zoom out and still see the sightings.

Problem #2: Some maps on taxon pages are centred strangely.
This only occurs with some taxa and I cannot seem to find any sort of reasoning behind why it occurs. When the map loads on a taxon page, it loads all of the relevant sightings of the taxon, and then tries to ‘centre’ the map so that it includes all of the sightings. Here’s a typical example of it working correctly:


It will even zoom in nicely if the sightings are all in a smaller geographic area:

But sometimes it seems to have a lot of trouble finding where the centre is, and does weird things. E.g. the family Anatidae has sightings from pretty much everywhere except Antarctica, so I would expect the map to try to centre itself roughly on the equator. But nope, it does this weird thing which cuts off a large number of observations:

I was thinking it might have been that the observations were so spread out that it couldn’t fit them all in and was making sure it included the most northern records but having trouble with the southern ones, but here is another case that is even more extreme, and in this case I can drag the map manually to easily include all of the relevant sightings:

This issue isn’t really affecting anyone, but it’s obviously not desired behaviour, and I’m really not sure what the cause could be.

These are the main issues and the two that I can replicate at least.

your Problem #1 seems to be related to the use of oversized (512px vs 256px) observation tiles in that map. the way this is implemented (probably to reduce the number of requests to the server?), it looks like you’re effectively losing one zoom level for the observation tiles. the observation detail page map allows you to zoom out all the way to zoom level 0, but technically because of the oversized tiles, the observation tiles can be generated only as low as zoom level 1.

compare the response that you get for the following API requests:

so the problem could be fixed by either using 256px sized tiles or limiting that map to a minimum of zoom level 1 or something like that.


your Problem #2 is partly a data issue, and partly related to the way the centering of observations works.

for example, regarding the data, there are suspicious verifiable observations of Anatidae very close to the north pole: https://www.inaturalist.org/observations?nelat=90&nelng=180&place_id=any&subview=map&swlat=82&swlng=-180&taxon_id=6912.

because of that, the map tries to show the map all the way up to near the north pole, which is actually off the range of the map (hence the white space at the top), since these kinds of web maps really aren’t designed to display stuff within a few degrees latitude of the poles.

as for why the bottom is cut off, the map is doing something whereby the map is effectively not centered vertically. i didn’t dig too deep into the issue, but the problem seems to be either that:

  • it’s already at the lowest zoom level (2) allowed in this particular map, and it prioritizes showing the top of bounding box over vertically centering the bounding box, or
  • it’s only displaying part of the bottom row of tiles (since it’s using oversized 512px tiles vs 256px tiles).

if you mark some of the suspicious observations as having bad locations, you will partially fix the problem in this specific case.

3 Likes

Thanks @pisum, a very thorough answer!