CIM37 - Country view
This commit is contained in:
@@ -217,8 +217,35 @@ $view .= '<div class="content-block">
|
||||
</div>
|
||||
';
|
||||
|
||||
//Get all related service events
|
||||
//SHOW LOCATION BASED ON GEOLOCATION
|
||||
if (!empty($responses->geolocation) || $responses->geolocation != ''){
|
||||
|
||||
$geolocation = json_decode($responses->geolocation,true);
|
||||
$view .= '<div class="content-block">
|
||||
<div id="map" style="height:300px;">
|
||||
</div>
|
||||
<script>
|
||||
// initialize Leaflet
|
||||
var map = L.map(\'map\').setView({lon: '.$geolocation[1].', lat: '.$geolocation[0].'}, 10);
|
||||
|
||||
// add the OpenStreetMap tiles
|
||||
L.tileLayer(\'https://tile.openstreetmap.org/{z}/{x}/{y}.png\', {
|
||||
maxZoom: 19,
|
||||
attribution: \'© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>\'
|
||||
}).addTo(map);
|
||||
|
||||
// show the scale bar on the lower left corner
|
||||
L.control.scale({imperial: true, metric: true}).addTo(map);
|
||||
|
||||
// show a marker on the map
|
||||
L.marker({lon: '.$geolocation[1].', lat: '.$geolocation[0].'}).bindPopup(\''.$responses->productname.'\').addTo(map);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
//Get all related service events
|
||||
if (isAllowed('servicereports',$_SESSION['profile'],$_SESSION['permission'],'R') === 1){
|
||||
$service_events = serviceEvents($history);
|
||||
|
||||
@@ -256,8 +283,6 @@ if ($update_allowed === 1){
|
||||
}
|
||||
$view .='</div>';
|
||||
|
||||
|
||||
|
||||
//OUTPUT
|
||||
echo $view;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user