Updated Building Map / added liezen export import script
This commit is contained in:
@@ -384,9 +384,13 @@
|
||||
accessToken: '<?=TT_MAPBOX_TILE_API_TOKEN?>'
|
||||
}).addTo(buildingMap);
|
||||
|
||||
L.MakiMarkers.accessToken = '<?=TT_MAPBOX_TILE_API_TOKEN?>';
|
||||
|
||||
addMarkers();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function addMarkers() {
|
||||
if(!Array.isArray(buildings) | !buildings.length) {
|
||||
return false;
|
||||
@@ -399,7 +403,36 @@
|
||||
}
|
||||
var gps = [building.gps_lat, building.gps_long];
|
||||
all_coords.push(gps);
|
||||
var marker = L.marker(gps).addTo(buildingMap);
|
||||
|
||||
var icon_color = "#CB2B3E";
|
||||
var icon_name = "home";
|
||||
|
||||
if(building.status == "connected") {
|
||||
icon_color = "#2AAD27";
|
||||
} else if(building.status == "pipework-done") {
|
||||
icon_color = "#CB8427";
|
||||
}
|
||||
|
||||
if(building.type.match(/^(Zwei)/i)) {
|
||||
icon_name = "town";
|
||||
} else if(building.type.match(/^(Mehr)/i)) {
|
||||
icon_name = "city";
|
||||
} else if(building.type.match(/^(Unternehmen)/i)) {
|
||||
icon_name = "industry";
|
||||
} else if(building.type.match(/^(Sender)/i)) {
|
||||
icon_name = "communications-tower";
|
||||
}
|
||||
|
||||
var marker_popup_content = '<?php include(realpath(dirname(__FILE__))."/include/building_popup.php");?>';
|
||||
|
||||
[["street", building.street], ["zip", building.zip], ["city", building.city], ["type", building.type], ["code", building.code], ["popname", building.popname], ["gps", building.gps_lat + ", " + building.gps_long],
|
||||
["contact", building.contact], ["phone", building.phone], ["email", building.email]
|
||||
].forEach(function(item) {
|
||||
marker_popup_content = marker_popup_content.replaceAll("{{" + item[0].toUpperCase() + "}}", item[1]);
|
||||
});
|
||||
|
||||
var icon = L.MakiMarkers.icon({icon: icon_name, color: icon_color, size: "l"});
|
||||
var marker = L.marker(gps, {icon: icon}).addTo(buildingMap).bindPopup(marker_popup_content);
|
||||
markers[building.id] = marker;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user