merge med master
authorJulie Hill Roa <julie.hill.roa@gmail.com>
Wed, 9 Dec 2015 20:09:38 +0000 (21:09 +0100)
committerJulie Hill Roa <julie.hill.roa@gmail.com>
Wed, 9 Dec 2015 20:09:38 +0000 (21:09 +0100)
1  2 
src/components/map/map.ts

@@@ -54,14 -53,7 +54,10 @@@ export class Map 
          this.uprunned = false;
          this.currentMarker = null;
          this.isSearched = false;
 -        // this.COLORS = {'red','brown',',yellow','green',',pink','purple','gray','black'};
 +        this.colornum = 0;
-         this.COLORS = ['#0a0f0f','#141f1f','#1f2e2e','#293d3d','#334c4c','#3d5c5c','#476b6b','#527a7a','#5c8a8a','#669999','#75a3a3','#85adad'];
++        this.COLORS = ['#0a0f0f', '#141f1f', '#1f2e2e', '#293d3d', '#334c4c', '#3d5c5c', '#476b6b', '#527a7a', '#5c8a8a', '#669999', '#75a3a3', '#85adad'];
 +        this.popupON = false;
-         this.popup=null;
-         this.hideModal = document.getElementById("topLevel").style.visibility = "hidden";
-         this.hideModal = document.getElementById("middleLevel").style.visibility = "hidden";
-         this.hideModal = document.getElementById("bottomLevel").style.visibility = "hidden";
-         this.hideModal = document.getElementById("divModal").style.display = "none";
++        this.popup = null;
      }
  
      setActiveId(id) {
                  instance.setcurrentPos(event.latLng);
  
                  if (instance.uprunned == false && instance.LEVEL == 2) {
-                     this.hideModal = document.getElementById("topLevel").style.visibility = "visible";
-                     this.hideModal = document.getElementById("middleLevel").style.visibility = "hidden";
-                     this.hideModal = document.getElementById("bottomLevel").style.visibility = "hidden";
-                     instance.showModal();
+                     this.hideModal = document.getElementById("topLevel").style.display = "block";
+                     this.hideModal = document.getElementById("middleLevel").style.display = "none";
+                     this.hideModal = document.getElementById("bottomLevel").style.display = "none";
                  }
                  else if (instance.runned == false && instance.LEVEL < instance.allLevels) {
-                     this.hideModal = document.getElementById("topLevel").style.visibility = "hidden";
-                     this.hideModal = document.getElementById("middleLevel").style.visibility = "visible";
-                     this.hideModal = document.getElementById("bottomLevel").style.visibility = "hidden";
-                     instance.showModal();
+                     this.hideModal = document.getElementById("topLevel").style.display = "none";
+                     this.hideModal = document.getElementById("middleLevel").style.display = "block";
+                     this.hideModal = document.getElementById("bottomLevel").style.display = "none";
                  } else if (instance.runned == false && instance.LEVEL <= instance.allLevels) {
-                     this.hideModal = document.getElementById("topLevel").style.visibility = "hidden";
-                     this.hideModal = document.getElementById("middleLevel").style.visibility = "hidden";
-                     this.hideModal = document.getElementById("bottomLevel").style.visibility = "visible";
+                     this.hideModal = document.getElementById("topLevel").style.display = "none";
+                     this.hideModal = document.getElementById("middleLevel").style.display = "none";
+                     this.hideModal = document.getElementById("bottomLevel").style.display = "block";
  
                      instance.setcurrentPos(event.latLng);
-                     instance.showModal();
                  }
              });
 +
 +
 +            this.map.data.addListener('mouseover', function (e) {


 +                if(!instance.popupON) {
 +                    instance.popupON = true;
 +                    console.log("hei");
 +                    instance.popup = new google.maps.InfoWindow({
 +                        content: e.feature.getProperty('name'),
 +                        position: e.latLng
 +                    });
 +                    instance.popup.open(instance.map);
 +
 +                }
 +            });

 +            this.map.data.addListener('mouseout', function (event) {


 +                instance.popupON = false;
 +                instance.popup.open(null);

 +            });
 +
          }
      }
  
          });
          this.currentMarker.setMap(map);
          map.panTo(this.currentMarker.getPosition());
 -
      }
  
-     showModal() {
-         return this.hideModal = document.getElementById("divModal").style.display = "block";
-     }
  
-     closeModal() {
-         this.hideModal = document.getElementById("topLevel").style.visibility = "hidden";
-         this.hideModal = document.getElementById("middleLevel").style.visibility = "hidden";
-         this.hideModal = document.getElementById("bottomLevel").style.visibility = "hidden";
-         this.hideModal = document.getElementById("divModal").style.display = "none";
 +
++
+     closeModal() {
+         $("#myModal").modal("hide");
          this.setRunned(false);
      }