uprunned:boolean;
activeId:string;
currentMarker:Object;
+ popup:Object;
// COLORS:Object;
this.currentPos = null;
this.uprunned = false;
this.currentMarker = null;
+ this.popup = null;
// this.COLORS = {'red','brown',',yellow','green',',pink','purple','gray','black'};
this.hideModal = document.getElementById("topLevel").style.visibility = "hidden";
this.hideModal = document.getElementById("middleLevel").style.visibility = "hidden";
upLevel() { this.LEVEL--; }
-
init() {
let map = this.map;
}
parseResult(res, instance, isParent) {
-
if (isParent) {
instance.setParent(res.parent.id);
instance.getData('/' + res.parent.id + '/children', instance, false);
}
}
}
-
drawPolygon(item, instance) {
let feature;
let incoming:string;
"icon": null
}
};
-
if (unit.geometry.type == 'Point') {
unit.properties.icon = {
path: google.maps.SymbolPath.CIRCLE,
+ strokeColor: 'black',
scale: 3
};
-
}
this.map.data.addGeoJson(unit);
});
});
-
this.map.data.addListener('click', function (event) {
instance.setActiveId(event.feature.O.id);
instance.setcurrentPos(event.latLng);
-
//TODO: finne liste over alle levels slike at man ikke har hardkodet inn < 4 !!
if (instance.uprunned == false && instance.LEVEL == 2) {
this.hideModal = document.getElementById("topLevel").style.visibility = "visible";
instance.setcurrentPos(event.latLng);
instance.showModal();
-
}
-
-
});
}
else {
map.data.forEach(function (feature) {
if (feature.getProperty('id') == id) {
feature.setProperty('color', 'red');
+ if (feature.getProperty('icon') !== null) {
+ feature.O.icon.strokeColor = 'red';
+ }
+ }
+ else {
+ feature.setProperty('color', 'gray');
+ if (feature.getProperty('icon') !== null) {
+ feature.O.icon.strokeColor = 'black';
+ }
}
});
this.newactive.next(this.activeId);
let pos = this.getcurrentPos();
let lat = pos.lat();
let lng = pos.lng();
-
let parent = this.getParent();
-
let location = {lat: lat, lng: lng};
let event = {location, parent};
this.neworg.next(event);
}
-
tempMarker(pos) {
let map = this.map;
- if(this.currentMarker)
+ if (this.currentMarker)
this.currentMarker.setMap(null);
this.currentMarker = new google.maps.Marker({
});
this.currentMarker.setMap(map);
}
+
showModal() {
return this.hideModal = document.getElementById("divModal").style.visibility = "visible";
}