Avoid Sorry, We Have No Images with Google Maps

I am writing a Google Maps application, for the most part it works great. But if I ask for walking routes between two points that are very close to each other (for example, 2 buildings that are next to each other), the map scales so close that the hybrid images turn into tiles that read "Sorry, we have no images here".

From the debugging notes in my code, you can see that the map zoom level is not set until the function that updates the DirectionsRenderer program (adding a call to map.getZoom () shows me the map zoom property for the previous round of directions that I requested.

Because of this, the MazZoomService is actually not very good at me. Is there a way to determine what level of map zooming will be when processing directions so that I can enlarge the image back to the point that it does not display an error message?

+7
source share
4 answers

Use the MaxZoomService inside the "zoom_changed" event on the map. If the current zoom level is greater than max, map.setZoom (max).

If you want to enable this behavior only from the results of updating the DirectionsRenderer, you need to set a flag and possibly a timer (DirectionsRenderer does not always change the map zoom level).

+5
source

<meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *; img-src * data: 'unsafe-inline'"> - add this tag to the header.

+3
source

I had this problem in an angular application, I am writing.

It turned out that my content security policy blocked Google, which, in turn, stopped all images from downloading and threw the error "Sorry, we do not have images here." As soon as I added the Google URL to my content security policy, everything went fine!

+1
source

I had this experience when I switched from satellite to map. At this point, the zoom setting was 18. I decided to zoom out. With a zoom size of 12 and below, the image error was resolved, and the map image showed well.

0
source

All Articles