if (Meteor.isClient) {
Meteor.startup(function() {
GoogleMaps.load({
key: 'A*************************g'
});
});
}
or look at this fiddle https://jsfiddle.net/9dgL1t8t/
App.accessRule('*');
App.accessRule('https://*.googleapis.com/*');
App.accessRule('https://*.google.com/*');
App.accessRule('https://*.gstatic.com/*');
App.setPreference('android-targetSdkVersion', '23');
App.setPreference("WebAppStartupTimeout", 60000);
adding startup time will allow maps to load completely.
GoogleMaps.ready 'myMap', (map) ->
markers = []
markerCluster = new MarkerClusterer(map.instance, markers, clusterOptions)
OK, I think I know what's happening my `Meteor.startup(function() {
GoogleMaps.load({ key: '<my key>', libraries: 'places'});
});` is not running. If I run it manually through Safari console, the map shows up.
I thought Meteor.startup should only run once Cordova is ready... thoughts?
const directionsService = new GoogleMaps.DirectionsService();
const directionsDisplay = new GoogleMaps.DirectionsRenderer();
function createRoute(start, end) {
directionsService.route({
origin: start,
destination: end,
travelMode: google.maps.DirectionsTravelMode.DRIVING
}, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
} else {
console.log('Nepovedlo se: ' + status);
}
});
}