Hey guys,
I’m using dburles:google-maps package with Blaze and the template inclusion:
{{> googleMap name="map" options=mapOptions}}
I have a list view and a map view navigated / rendered with FlowRouter and BlazeLayout respectably.:
FlowRouter.route('/', {
name: 'list',
action() {
BlazeLayout.render('App_body', { main: 'List_list'});
},
});
FlowRouter.route('/map', {
name: 'map',
action() {
BlazeLayout.render('App_body', { main: 'Map_map'});
},
});
If I start the app or refresh the page and then navigate to the map view, the google map loads perfectly. If I navigate away from the map (to list for instance) and then back to map, the google map is just grey.
Here is some of my other map code:
Template.Map_map.helpers({
mapOptions() {
if (GoogleMaps.loaded()) {
const center = new google.maps.LatLng(44.477553, -73.199853);
return {
center,
zoom: 16,
};
}
},
});
…and I call GoogleMaps.load();
in onCreated.
Thanks for the help guys!