This is because the map moves when we select one of these icons (to ensure the info window is entirely visible). However, it shouldn't close the info window. I suspect this is because the icons are all being redrawn and in doing so, the map is first cleared.
I think we should first determine if we need to clear the map. Do off-screen markers significantly impact performance? I would expect them to have a much smaller impact. In fact, I realize now that I don't think we tested if we could just plot everything and let Maps handle whether a marker is visible.
If we do, then one fix is to not clear the map if the info window is open. This is very easy to do. And since the movement shouldn't be great, there won't be many missing icons. But there still will be some.
Perhaps the most ideal compromise (if we do have to clear the map) is to only clear the map if the info window is not visible. Otherwise we just add the new locations to the location array and draw just the new ones.
This is because the map moves when we select one of these icons (to ensure the info window is entirely visible). However, it shouldn't close the info window. I suspect this is because the icons are all being redrawn and in doing so, the map is first cleared.
I think we should first determine if we need to clear the map. Do off-screen markers significantly impact performance? I would expect them to have a much smaller impact. In fact, I realize now that I don't think we tested if we could just plot everything and let Maps handle whether a marker is visible.
If we do, then one fix is to not clear the map if the info window is open. This is very easy to do. And since the movement shouldn't be great, there won't be many missing icons. But there still will be some.
Perhaps the most ideal compromise (if we do have to clear the map) is to only clear the map if the info window is not visible. Otherwise we just add the new locations to the location array and draw just the new ones.