merge master i modalboks
authorRoza Moustafa <roza.92m@hotmail.com>
Thu, 3 Dec 2015 12:27:42 +0000 (13:27 +0100)
committerRoza Moustafa <roza.92m@hotmail.com>
Thu, 3 Dec 2015 12:27:42 +0000 (13:27 +0100)
1  2 
src/components/map/map.ts

@@@ -33,16 -33,7 +34,17 @@@ export class Map 
          this.parent = null;
          this.currentPos = null;
          this.uprunned = false;
+         // this.COLORS = {'red','brown',',yellow','green',',pink','purple','gray','black'};
 +        this.hideModal = document.getElementById("divModal").style.visibility = "hidden";
 +    }
 +
 +    showModal(){
 +        return this.hideModal = document.getElementById("divModal").style.visibility = "visible";
 +    }
 +
 +    closeModal(){
 +        console.log("hei");
 +        return this.hideModal = document.getElementById("divModal").style.visibility = "hidden";
  
      }
  
                  "properties": {
                      "name": item.name,
                      "id": item.id,
-                     "color": "yellow",
+                     "color": "gray",
+                     "icon": null
                  }
              };
              if (unit.geometry.type == 'Point') {
-                 //ToDO: add en style på markeren !
+                 unit.properties.icon = {
+                     path: google.maps.SymbolPath.CIRCLE,
+                     scale: 3
+                 };
  
              }
 -            console.log("her er iden: " +unit.properties.id);
 +
              this.map.data.addGeoJson(unit);
+             this.map.data.setStyle(function(feature) {
+                 let color = 'gray';
+                 let icon;
+                 if (feature.getProperty('icon')!== null) {
+                    icon = feature.getProperty('icon');
+                 }
+                 color = feature.getProperty('color');
+                 return /** @type {google.maps.Data.StyleOptions} */({
+                     fillColor: color,
+                     strokeColor: color,
+                     strokeWeight: 2,
+                     icon: icon
+                 });
+             });
  
              this.map.data.addListener('click', function (event) {