Skip to content
Snippets Groups Projects
Commit 4535ef09 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

rename of method name

parent 368c6675
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -145,37 +145,37 @@ CustomMap.prototype.clearDbOverlays = function() {
};
/**
* Removes all markers from {@link OverlayCollection}.
* Removes all markers from {@link AbstractDbOverlay}.
*
* @param collection
* {@link OverlayCollection} from which all markers should be removed
*/
CustomMap.prototype.hideMarkersForOverlayCollection = function(collection) {
logger.debug("Clear collection: " + collection.name);
for ( var aliasKey in collection.aliasMarkers) {
if (collection.aliasMarkers.hasOwnProperty(aliasKey) && collection.aliasMarkers[aliasKey] !== undefined
&& collection.aliasMarkers[aliasKey] !== null) {
collection.aliasMarkers[aliasKey].setMap(null);
CustomMap.prototype.hideMarkersForDbOverlay = function(dbOverlay) {
logger.debug("Clear dbOverlay: " + dbOverlay.name);
for ( var aliasKey in dbOverlay.aliasMarkers) {
if (dbOverlay.aliasMarkers.hasOwnProperty(aliasKey) && dbOverlay.aliasMarkers[aliasKey] !== undefined
&& dbOverlay.aliasMarkers[aliasKey] !== null) {
dbOverlay.aliasMarkers[aliasKey].setMap(null);
}
}
for ( var pointKey in collection.pointMarkers) {
if (collection.pointMarkers.hasOwnProperty(pointKey) && collection.pointMarkers[pointKey] !== undefined
&& collection.pointMarkers[pointKey] !== null) {
collection.pointMarkers[pointKey].setMap(null);
for ( var pointKey in dbOverlay.pointMarkers) {
if (dbOverlay.pointMarkers.hasOwnProperty(pointKey) && dbOverlay.pointMarkers[pointKey] !== undefined
&& dbOverlay.pointMarkers[pointKey] !== null) {
dbOverlay.pointMarkers[pointKey].setMap(null);
}
}
for ( var key in collection.reactionMarkers) {
if (collection.reactionMarkers.hasOwnProperty(key) && collection.reactionMarkers[key] !== undefined
&& collection.reactionMarkers[key] !== null) {
collection.reactionMarkers[key].setMap(null);
for ( var key in dbOverlay.reactionMarkers) {
if (dbOverlay.reactionMarkers.hasOwnProperty(key) && dbOverlay.reactionMarkers[key] !== undefined
&& dbOverlay.reactionMarkers[key] !== null) {
dbOverlay.reactionMarkers[key].setMap(null);
}
}
collection.aliasMarkers = [];
collection.pointMarkers = [];
collection.reactionMarkers = [];
dbOverlay.aliasMarkers = [];
dbOverlay.pointMarkers = [];
dbOverlay.reactionMarkers = [];
};
/**
......@@ -188,7 +188,7 @@ CustomMap.prototype.hideMarkersForOverlayCollection = function(collection) {
* after update, <code>false</code> otherwise
*/
CustomMap.prototype.updateOverlayCollection = function(overlayCollection, fitBounds) {
this.hideMarkersForOverlayCollection(overlayCollection);
this.hideMarkersForDbOverlay(overlayCollection);
return this.renderOverlayCollection({
overlayCollection : overlayCollection,
fitBounds : fitBounds
......@@ -312,7 +312,7 @@ CustomMap.prototype.refreshComments = function() {
var collection = self.getOverlayByName("comment");
if (collection !== undefined) {
self.hideMarkersForOverlayCollection(collection);
self.hideMarkersForDbOverlay(collection);
if (ServerConnector.getSessionData(self.getProject()).getShowComments()) {
return collection.refresh().then(function() {
return self.renderOverlayCollection({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment