Commit 975c7cf8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix after refactoring

parent 0a4f02af
......@@ -216,21 +216,24 @@ CustomMap.prototype.clearOverlayCollection = 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] !== undefined
&& collection.aliasMarkers[aliasKey] !== null) {
collection.aliasMarkers[aliasKey].setMap(null);
}
}
for ( var pointKey in collection.pointMarkers) {
if (collection.pointMarkers.hasOwnProperty(pointKey)
&& collection.pointMarkers[pointKey] !== undefined) {
&& collection.pointMarkers[pointKey] !== undefined
&& collection.pointMarkers[pointKey] !== null) {
collection.pointMarkers[pointKey].setMap(null);
}
}
for ( var key in collection.reactionMarkers) {
if (collection.reactionMarkers.hasOwnProperty(key)
&& collection.reactionMarkers[key] !== undefined) {
&& collection.reactionMarkers[key] !== undefined
&& collection.reactionMarkers[key] !== null) {
collection.reactionMarkers[key].setMap(null);
}
}
......@@ -468,7 +471,8 @@ CustomMap.prototype.refreshOverlayMarkers = function(overlay) {
var bounds;
for ( var aliasKey in overlay.aliasMarkers) {
if (overlay.aliasMarkers.hasOwnProperty(aliasKey)
&& overlay.aliasMarkers[aliasKey] !== undefined) {
&& overlay.aliasMarkers[aliasKey] !== undefined
&& overlay.aliasMarkers[aliasKey] !== null) {
var alias = overlay.aliasMarkers[aliasKey];
if (alias.getAliasData() === null || alias.getAliasData() === undefined) {
var aliasData = alias.getCustomMap().mapModel.getAliasById(alias
......@@ -499,7 +503,8 @@ CustomMap.prototype.refreshOverlayMarkers = function(overlay) {
for ( var key in overlay.pointMarkers) {
if (overlay.pointMarkers.hasOwnProperty(key)
&& overlay.pointMarkers[key] !== undefined) {
&& overlay.pointMarkers[key] !== undefined
&& overlay.pointMarkers[key] !== null) {
var pointMarker = overlay.pointMarkers[key];
// we don't need to update this markers because thet data about
// visualization is
......@@ -517,7 +522,8 @@ CustomMap.prototype.refreshOverlayMarkers = function(overlay) {
for ( var reactionKey in overlay.reactionMarkers) {
if (overlay.reactionMarkers.hasOwnProperty(reactionKey)
&& overlay.reactionMarkers[reactionKey] !== undefined) {
&& overlay.reactionMarkers[reactionKey] !== undefined
&& overlay.reactionMarkers[reactionKey] !== null) {
var reactionOverlay = overlay.reactionMarkers[reactionKey];
if (reactionOverlay.getReactionData() === null
|| reactionOverlay.getReactionData() === undefined) {
......
......@@ -37,7 +37,8 @@ AbstractMarker.prototype.show = function() {
logger.warn("Cannot show marker. Marker not initialized");
return;
}
if (this.getGoogleMarker().getMap() !== undefined) {
if (this.getGoogleMarker().getMap() !== undefined
&& this.getGoogleMarker().getMap() !== null) {
logger.warn("Marker is already shown");
} else {
this.getGoogleMarker().setMap(this._map.map);
......
......@@ -277,7 +277,8 @@ AbstractInfoWindow.prototype._createDefaultInfoDiv = function(overlay, data) {
titleElement.appendChild(title);
divElement.appendChild(titleElement);
for ( var searchId in data) {
if (data.hasOwnProperty(searchId) && data[searchId] !== undefined) {
if (data.hasOwnProperty(searchId) && data[searchId] !== undefined
&& data[searchId] !== null) {
count++;
var resultTitleElement = document.createElement("h4");
var resultTitle = document.createTextNode(searchId);
......@@ -438,7 +439,8 @@ AbstractInfoWindow.prototype._createTargetInfoDiv = function(overlay, data,
count = 0;
for ( var dataId in data) {
if (data.hasOwnProperty(dataId) && data[dataId] !== undefined) {
if (data.hasOwnProperty(dataId) && data[dataId] !== undefined
&& data[dataId] !== null) {
// if we have empty array, it means that we got data from server and it's
// empty
if (Object.prototype.toString.call(data[dataId]) === '[object Array]') {
......@@ -454,7 +456,8 @@ AbstractInfoWindow.prototype._createTargetInfoDiv = function(overlay, data,
table.appendChild(row);
for ( var searchId in data) {
if (data.hasOwnProperty(searchId) && data[searchId] !== undefined) {
if (data.hasOwnProperty(searchId) && data[searchId] !== undefined
&& data[searchId] !== null) {
// if we have empty array, it means that we got data from server and
// it's
// empty
......
......@@ -34,6 +34,7 @@ function create(params) {
} else {
logger.setLevel("info");
}
GuiConnector.init();
} else {
logger.warn("global GuiConnector found");
}
......
......@@ -43,6 +43,7 @@ function initMap(){
bigLogo : windowsTouchInterface,
overviewDiv : overviewDiv,
customTouchInterface: windowsTouchInterface,
debug:false,
dataCollections: [
{name: "search"},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment