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;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<div class="font-weight-bold">
|
||||
{{STREET}}<br />
|
||||
{{ZIP}} {{CITY}}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Objekt-ID:</th>
|
||||
<td>{{CODE}}</td>
|
||||
</tr><tr>
|
||||
<th>Gebäudetyp:</th>
|
||||
<td>{{TYPE}}</td>
|
||||
</tr><tr>
|
||||
<th>POP:</th>
|
||||
<td>{{POPNAME}}</td>
|
||||
</tr><tr>
|
||||
<th>GPS:</th>
|
||||
<td><a href="https://maps.google.com/maps?t=k&q=loc:{{GPS}}">{{GPS}}</a></td>
|
||||
</tr><tr>
|
||||
<th>Kontakt:</th>
|
||||
<td>{{CONTACT}}</td>
|
||||
</tr><tr>
|
||||
<th>Telefon:</th>
|
||||
<td>{{PHONE}}</td>
|
||||
</tr><tr>
|
||||
<th>Email:</th>
|
||||
<td>{{EMAIL}}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<?=str_replace("\n"," ",ob_get_clean())?>
|
||||
Reference in New Issue
Block a user