CIM37 - Update OSM to TSS Icons

This commit is contained in:
“VeLiTi”
2024-04-03 16:59:48 +02:00
parent b79a33b9dc
commit 2cb07cfd47
5 changed files with 114 additions and 9 deletions

View File

@@ -141,18 +141,33 @@ if (!empty($geolocation)){
if (!empty($gloc->geolocation) || $gloc->geolocation != '' || $gloc->geolocation != null ){
$glocation = json_decode($gloc->geolocation) ?? '';
if ($glocation[0] != null){
$add_pos .= 'L.marker({lon: '.$glocation[1].', lat: '.$glocation[0].'}).bindPopup(\''.$gloc->serialnumber.'\').addTo(map);';
$add_pos .= 'L.marker(['.$glocation[0].', '.$glocation[1].'],{icon: TSSemp}).addTo(map);';
}
}
}
$view .= '<div class="content-block">
<div id="map" style="height:300px;">
<div id="map" style="height:300px;z-index: 0;">
</div>
<script>
// initialize Leaflet
var map = L.map(\'map\').setView({lon: 5.1938101, lat: 51.5778742}, 2);
//Add TSS Avatar to MAP
var TSSAvatar = L.icon({
iconUrl: \'./assets/images/tss-persoon.svg\',
iconSize: [35, 55], // size of the icon
});
//Add TSS Avatar to MAP
var TSSemp = L.icon({
iconUrl: \'./assets/images/EP.png\',
iconSize: [50, 50], // size of the icon
});
L.marker([51.5778742,5.1938101], {icon: TSSAvatar}).addTo(map);
// add the OpenStreetMap tiles
L.tileLayer(\'https://tile.openstreetmap.org/{z}/{x}/{y}.png\', {
maxZoom: 19,