async-google-maps | Asynchronous loading and creation of google maps | REST library
kandi X-RAY | async-google-maps Summary
kandi X-RAY | async-google-maps Summary
Asynchronous loading and creation of google maps.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of async-google-maps
async-google-maps Key Features
async-google-maps Examples and Code Snippets
Community Discussions
Trending Discussions on async-google-maps
QUESTION
I am trying to set a system whereby a Google Map appears in a popup iframe [using Fancybox], I have read a lot of similar topics on Stack Overflow and I have already implemented many of their suggestions with no success.
The issue is:
Uncaught ReferenceError: google is not defined
When the iframe is loaded. The iframe loads its data correctly (and this can be viewed on browser console) but Google maps fails to appaer and the console error (above) indicates it fails to initialise.
Some things I've aready tried or that do not apply:- I have a callback function set up
- I am using a Javascript Map API rather than the
v3
version. - I have tried with both
async
anddefer
without success. - I do not want the map to be the sole contents of the iframe (embedded Google map).
- I have tried using a window load javascript event detector without success (from another Question).
- The issue is not the iframe itself - that works - it's the relationship between the frame and its parent.
Annoyingly, this popup map system was working just fine after an hour of trial and error and then I cleared my browser history (or did something else) that now means the issue has returned and won't go away.
Iframe page:
...ANSWER
Answered 2017-Aug-02 at 19:36The original issue notice in the console was:
Uncaught ReferenceError: google is not defined
This notice appears anyway even when the map loads successfully.
The reason for the map not loading/displaying correctly was the CSS; I had set the CSS of the #map_canvas
element to being a %
of the width
/height
values rather than as an absolute pixel dimension.
While %
dimensions do not work, you can use Viewport-height and Viewport-width values (vh
,vw
), and the map takes up this space in the iframe.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install async-google-maps
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page