Copy link to clipboard
Copied
A client is running the google maps search by proximity module. This works fine, except some selections don't generate a map, resulting in an empty div where the map should be (but isn't because there aren't any results.) So the client wanted to add "no results found" into the empty layer, which is easy enough with javascript. Except that now when there is a map, the js detects that that div is empty (because the map is added by javascript), and adds "no results found" until the map overwrites it.
And then I thought about maybe doing a callback on the google maps code except it doesn't even appear when there's no result.
So my question is, how can I set a textual default for the map layer when this happens?
Copy link to clipboard
Copied
Hi Kenneth,
if (typeof google === 'object' && typeof google.maps === 'object') { your code }
This will detect if the maps module is rendered or not.
Kind Regards,
Alex.