GoogleWebComponents / google-map

Google Maps web components

Home Page:https://elements.polymer-project.org/elements/google-map

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google-map: non-integer zoom value will not load new tiles

timblack1 opened this issue · comments

Is it possible to use non-integer zoom values with a <google-map> element?

My use case is that I am letting the user search for placemarks on the map within a certain search radius which the user specifies in miles or kilometers. This is implemented by zooming the map to that search radius, then displaying the placemarks within that map's bounds.

So, I'm trying to use non-integer values (like 9.54) to zoom a <google-map> element's map. https://developers.google.com/maps/documentation/javascript/3.exp/reference says "Valid values: Integers between zero, and up to the supported maximum zoom level." So maybe it's not possible to use non-integer zoom values.

However, Google's main maps interface does permit non-integer zoom values, like this: https://www.google.com/maps/place/Going-To-The-Sun+Rd,+West+Glacier,+MT+59936/@48.6772313,-113.6551795,16.91z/data=!4m5!3m4!1s0x5368a6c3d391bf1b:0xfa79dd2585d7b95f!8m2!3d48.6782903!4d-113.6536738. The zoom value there appears to be 16.91. This indicates it might still be possible to use non-integer zoom values.

So, are non-integer values supported, or is there a way to make them work?

What does work:

When I try using a non-integer zoom value with a <google-map> element, the map appears to zoom in or out the correct amount.

What doesn't work:

What doesn't work correctly is that when the map is zoomed out, I can see that the tiles just outside the map's original bounds have not loaded or displayed correctly; instead, there is only gray space where the tiles should display.

A second, and maybe related, issue is that when the map is zoomed in or out a certain amount then the original tiles disappear, and no tiles display; only gray space displays.