In my project I am using Phonegap Googlemap Plugin from https://github.com/wf9a5m75/phonegap-googlemaps-plugin . For MapDrag event I use CAMERA_CHANGE event for getting center of the map each time the camera is changed. But to bind the scope to the variable I have to set clickable of map to false But it not work properly. Can anyone give me better solution.
homeMap.on(plugin.google.maps.event.CAMERA_CHANGE, function onMapCameraChanged(position) {
homeMap.setClickable(false);
$scope.getcent(position.target.lat,position.target.lng);
});
$scope.getcent = function(requestlat, requestlng){
console.log("latLng"+requestlat+" "+requestlng);
var geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(requestlat, requestlng);
var latlng = new google.maps.LatLng(requestlat, requestlng);
if (dropdownvar == 1) {
geocoder.geocode({'latLng':latlng}, function address(results, status){
if (status == google.maps.GeocoderStatus.OK) {
setpickup = results[1].formatted_address;
console.log(setpickup);
$scope.startpoint = setpickup;
homeMap.setClickable(true);
};
})
} else if (dropdownvar == 0) {
// homeMap.setClickable(false);
geocoder.geocode({'latLng':latlng}, function address(results, status){
if (status == google.maps.GeocoderStatus.OK) {
setpickup = results[1].formatted_address;
console.log(setpickup);
$scope.endpoint = setpickup;
homeMap.setClickable(true);
};
})
};
};