Hi
I seem to have solved the google map cropping problem but am now facing a slightly different challenge.
I'm calling the initialize() function on page load with a timeout of 50 but it seems to be taking quite some time to finish is there any way to wait till completion ?
Because subsequent marker calls like map.fitBounds(bounds) is failing as map' isn't getting initialized . Please note : For me 'Render all pages in one HTML file' is ON
Here is the code again
function initialize()
{
console.log('Initializing Map...');
Code: Select all
map = Apperyio("google_map").gmap;
if (!map) {
setDelay();
}
}
function mylocationmarker()
{
var iconBase = 'https://maps.google.com/mapfiles/kml/...';
var markerLatLng = new google.maps.LatLng(localStorage.getItem('markerLat'), localStorage.getItem('markerLng'));
var marker = new google.maps.Marker({
position: markerLatLng,
map: map,
title: 'My position',
animation: google.maps.Animation.DROP,
icon: iconBase + 'man_maps.png'
});
markers.push(marker);
bounds.extend(markerLatLng);
map.fitBounds(bounds);
}