Skip to content

Instantly share code, notes, and snippets.

@madzhuga
Created January 12, 2015 18:16
Show Gist options
  • Save madzhuga/de7c164e065ad17533ff to your computer and use it in GitHub Desktop.
Save madzhuga/de7c164e065ad17533ff to your computer and use it in GitHub Desktop.
merge result.txt
$scope.addZoomListener = function () {
$scope.zoomListener = google.maps.event.addListener($scope.map, 'zoom_changed', function () {
//when zoom changed we need to clear all old markers
// as it changes regions to their parents etc
$scope.calculatePortInfoPosition();
$scope.cleanAllMarkers();
$scope.reloadMarkers();
});
};
$scope.cleanAllMarkers = function () {
$.each($scope.map.ports, function (i, port) {
port.setMap(null)
});
$scope.map.ports = [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment