dburles / meteor-google-maps

🗺 Meteor package for the Google Maps Javascript API v3
https://atmospherejs.com/dburles/google-maps
MIT License
196 stars 48 forks source link

on mobile (Android & iOS) : google undefined #153

Open madc0w opened 6 years ago

madc0w commented 6 years ago

In mobile-config.js, we have:

App.accessRule("*.google.com/*");
App.accessRule("*.googleapis.com/*");
App.accessRule("*.gstatic.com/*");

And yet, this:

    Tracker.autorun(() => {
        if (GoogleMaps.loaded()) {
            geocoder.set(new google.maps.Geocoder());
        }
    });

yields the following stack:

(anonymous function) — client.js:54 [ the line above that references google.maps.Geocoder ] _compute — tracker.js:339 _recompute — tracker.js:358 _runFlush — tracker.js:532 onGlobalMessage — meteor.js:426

We also see, probably when attempting to instantiate a map:

No message (1) create — dburles_google-maps.js:144 (anonymous function) — dburles_google-maps.js:168 (anonymous function) — blaze.js:1934 _withTemplateInstanceFunc — blaze.js:3744 (anonymous function) — blaze.js:1932 _withCurrentView — blaze.js:2271 Template.googleMap:anonymous — blaze.js:1931 _compute — tracker.js:339 Computation — tracker.js:229 autorun — tracker.js:613 autorun — blaze.js:1944 autorun — blaze.js:3604 (anonymous function) — dburles_google-maps.js:152 (anonymous function) — blaze.js:3398 _withTemplateInstanceFunc — blaze.js:3744 fireCallbacks — blaze.js:3394 (anonymous function) — blaze.js:3487 (anonymous function) — blaze.js:1845 _withCurrentView — blaze.js:2271 (anonymous function) — blaze.js:1844 _runFlush — tracker.js:548 onGlobalMessage — meteor.js:426

dburles commented 6 years ago

If the geocoding library is loaded externally make sure that you use loadUtilityLibrary so that the GoogleMaps.loaded covers loading state for it too. Edit: Looks like it's not a utility library

dburles commented 6 years ago

Also try this https://github.com/dburles/meteor-google-maps/issues/131