question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google map target DIV is blank

See original GitHub issue

I’m submitting a … (check one with “x”)

  • question
  • any problem or bug report
  • feature request

If you choose ‘problem or bug report’, please select OS: (check one with “x”)

  • Android
  • iOS

cordova information: (run $> cordova plugin list)

branch-cordova-sdk 2.6.23 "branch-cordova-sdk"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.2.9 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.3.2 "SocialSharing"
es6-promise-plugin 4.2.2 "Promise"
onesignal-cordova-plugin 2.3.2 "OneSignal Push Notifications"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

"@ionic-native/core": "4.4.0",
"@ionic-native/google-maps": "^4.6.1"

Current behavior:

After the button is pressed or a location is searched, the target div of the map simply displays the text GOOGLE with neither map nor marker.

Expected behavior:

I just want the map div to load or display a map with the location parameters it is handed.

Screen capture or video record:

20180404_153219 1

Related code, data or error log (please format your code or data): sometimes, it throws the following errors

[ignore]map_0_830091793909.setOptions, because it's not ready
Uncaught (in promise): TypeError: Cannot read property 'position' of undefined

But mostly says nothing and doesn’t display the map.

The component code can be found at this gist, while the markup is very basic

<ion-content padding>
<div #displayMap id="displayMap"></div>
</ion-content>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
wf9a5m75commented, Apr 8, 2018

No contribution, no help.

1reaction
wf9a5m75commented, Apr 5, 2018

And did you read my advice?

this.map.setOptions( mapOptions); has to execute after the MAP_READY event.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to override target=_blank in KML popups in embedded ...
I'm using KML to overlay shapes on a Google map. Information corresponding to each shape is included in the <description> element, along with...
Read more >
Maps JavaScript API | Google Developers
To change the viewport while the map is hidden, set the map to visibility: hidden , thereby ensuring the map div has an...
Read more >
<iframe>: The Inline Frame element - HTML - MDN Web Docs
Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or...
Read more >
HTML target Attribute - W3Schools
For <a> and <area> elements, the target attribute specifies where to open the linked ... An image map, with clickable areas, and a...
Read more >
Google Map wont load in AJAX-loaded page. - CSS-Tricks
I'm using google map API V3 and i have a container within an AJAX ... the AJAX div where the content is loaded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found