On Google Map screen my app crashes???? Urgent please

I am calling Geo-location service after 5 seconds.. within 1 hour while driving the app crashed almost 4 times.
Please help me with this issue. Its really urgent.

I am using this code on geolocation success:

var map = Appery('InspectionMaps');

map.setProperty('address','');
map.refresh();

//Note: you need replace "googlemap_1" with your google map component name.
//alert("geo service call");
var map = Appery("InspectionMaps").options.mapElement.gmap('get', 'map');

var markerLatLng = new google.maps.LatLng(localStorage.getItem('currLat'), localStorage.getItem('currLong'));
//alert('marker lat long'+localStorage.getItem('currLat'));

var marker = new google.maps.Marker({
position: markerLatLng,
map: map,
icon: 'http://61.88.31.132/Fireh/Images/mark...',
optimized: false,
// animation: google.maps.Animation.DROP,
title: "Your Location"
});

//If old marker almost here
if(self.uniqueMarker && self.uniqueMarker.setMap)

//Delete old marker from map.

self.uniqueMarker.setMap(null);

self.uniqueMarker = marker;

google.maps.event.addListener(marker, 'click', function() {

if( confirm('Do you want to add inspection details for this property?')===true)
{
Appery.navigateTo('AddPropertyDetails');
}

});

markers.push(marker);

google.maps.event.addListener(map, 'zoom_changed', function() {

var zoomLevel = map.getZoom();

console.log('zoom level '+ zoomLevel);
if(zoomLevel === '')
{
zoomLevel = 11;
}
else if(isNaN(zoomLevel))
{

zoomLevel = 11;
}
localStorage.setItem('pageZoom',zoomLevel);
});

var prevZoom = parseInt(localStorage.getItem('pageZoom'));

if(isNaN(prevZoom))
{
prevZoom = 11;
}
else if (prevZoom==='')
{
prevZoom = 11;
}

if(prevZoom===11 && localStorage.getItem('searchScreen')==='1')
{
map.setZoom(prevZoom);
}
else
{
map.setZoom(prevZoom);
}
1 person has
this problem
+1
This topic is no longer open for comments or replies.