I've managed to get the map to work without receiving the error.
I'm storing lat and lng values in the db.
on the previous page when list item is clicked, the _id and lat and lng values are now
saved to local storage and the page navigates to the current page.
on page show:
pre
var mapO = Apperyio("google_mapNight").gmap;
Code: Select all
if (!mapO)
{
setDelayO();
}
else
{
initializeNO();
}
function setDelayO()
{
setTimeout(500);
}
/pre
I have a js file:
pre
var mapO;
var boundsO = new google.maps.LatLngBounds();
var markerLatLngO = new google.maps.LatLng(localStorage.getItem('markerLat'), localStorage.getItem('markerLng'));
function initializeNO() {
console.log('Initializing...');
var myOptions = {
zoom :20,
center: new google.maps.LatLng(markerLatLngO),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
mapO = new google.maps.Map($('div[dsid="google_mapNight"]').get(0), myOptions);
//mapO = Apperyio("google_mapNight").gmap;
var marker = new google.maps.Marker({
position: markerLatLngO,
map: mapO,
animation: google.maps.Animation.DROP,
zoom: 20
});
aofmarkers.push(marker);
boundsO.extend(markerLatLngO);
mapO.fitBounds(boundsO);
}/pre
The map now works.
the only problem is, whenever I invoke a read service, I get the error.
even if the service is not connected with the map.