Faserplanung
* Rohrplanung Updates * Migrations
This commit is contained in:
@@ -37,13 +37,16 @@ foreach ($pipworkeraddresses as $pipworkeraddress):
|
||||
|
||||
endforeach;
|
||||
|
||||
foreach ($networks as $network):
|
||||
$Network[$network->id] = $network->name;
|
||||
foreach ($fiberplanpipeendpoints as $fiberplanpipeEndpoint):
|
||||
if ($fiberplanpipeEndpoint->pop_id) {
|
||||
$networks[$fiberplanpipeEndpoint->pop->network->name] = $fiberplanpipeEndpoint->pop->network->name;
|
||||
} else if ($fiberplanpipeEndpoint->building_id) {
|
||||
$networks[$fiberplanpipeEndpoint->building->network->name] = $fiberplanpipeEndpoint->building->network->name;
|
||||
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher_id) {
|
||||
$networks[$fiberplanpipeEndpoint->fiberPlanDispatcher->network->name] = $fiberplanpipeEndpoint->fiberPlanDispatcher->network->name;
|
||||
}
|
||||
endforeach;
|
||||
|
||||
$allNetworks[$fiberplanpipes->startpoint_network_id] = $Network[$fiberplanpipes->startpoint_network_id];
|
||||
$allNetworks[$fiberplanpipes->endpoint_network_id] = $Network[$fiberplanpipes->endpoint_network_id];
|
||||
|
||||
if ($fiberplanpipes->address_id) {
|
||||
$responsible = $Pipeworkers[$fiberplanpipes->address_id];
|
||||
} else {
|
||||
@@ -286,7 +289,7 @@ if ($fiberplanpipes->type == "3") {
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Netzgebiet (e)</th>
|
||||
<td><?= implode(', ', $allNetworks) ?> </td>
|
||||
<td><?= implode(', ', $networks) ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Rohrtyp</th>
|
||||
@@ -361,6 +364,11 @@ if ($fiberplanpipes->type == "3") {
|
||||
$endpointtype = $fiberplanpipestypes[$endpoint->fiberPlanDispatcher->object_type];
|
||||
$gps_lat = $endpoint->fiberPlanDispatcher->gps_lat;
|
||||
$gps_long = $endpoint->fiberPlanDispatcher->gps_long;
|
||||
} elseif ($endpoint->building_id) {
|
||||
$endpointname = $endpoint->building->street;
|
||||
$endpointtype = 'Building';
|
||||
$gps_lat = $endpoint->building->gps_lat;
|
||||
$gps_long = $endpoint->building->gps_long;
|
||||
}
|
||||
$coordinates = "";
|
||||
if ($gps_lat) {
|
||||
@@ -391,13 +399,12 @@ if ($fiberplanpipes->type == "3") {
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
if ($gps_lat) {
|
||||
$markers[] = array(
|
||||
"gps_lat" => $gps_lat,
|
||||
"gps_long" => $gps_long,
|
||||
"name" => $endpointname,
|
||||
);
|
||||
}
|
||||
$markers[] = array(
|
||||
"gps_lat" => $gps_lat,
|
||||
"gps_long" => $gps_long,
|
||||
"name" => $endpointname,
|
||||
"type" => $endpointtype
|
||||
);
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
@@ -447,7 +454,29 @@ if ($fiberplanpipes->type == "3") {
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="map"></div>
|
||||
<div class="row">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-1"></div>
|
||||
<div class="col-lg-9 "><h4>Legende:</h4></div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-1"></div>
|
||||
<div class="col-lg-4"><img src="<?= self::getResourcePath() ?>img/markers/marker-pop.png ">
|
||||
<label class="font-16"> ... Pop</label></div>
|
||||
<div class="col-lg-4"><img src="<?= self::getResourcePath() ?>img/markers/marker-home.png ">
|
||||
<label class="font-16"> ... Building</label></div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-1"></div>
|
||||
<div class="col-lg-4 justify-content-center"><img
|
||||
src="<?= self::getResourcePath() ?>img/markers/marker-dispatcher.png "> <label
|
||||
class="font-16"> ... Schacht/Verteiler</label></div>
|
||||
<div class="col-lg-4"><img
|
||||
src="<?= self::getResourcePath() ?>img/markers/marker-greenfield.png "> <label
|
||||
class="font-16"> ... Greenfield</label></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Schließen</button>
|
||||
@@ -458,13 +487,15 @@ if ($fiberplanpipes->type == "3") {
|
||||
<?php if ($markers) :
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
var marker;
|
||||
var fitmap = 0;
|
||||
var marker = [];
|
||||
var polylinec;
|
||||
var polyline;
|
||||
var map = L.map('map').setView([51.505, -0.09], 13);
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19
|
||||
L.tileLayer('https://mapsneu.wien.gv.at/basemap/{id}/normal/google3857/{z}/{y}/{x}.{imgtype}', {
|
||||
maxZoom: 19,
|
||||
id: "geolandbasemap",
|
||||
imgtype: "png"
|
||||
}).addTo(map);
|
||||
L.MakiMarkers.accessToken = '<?=TT_MAPBOX_TILE_API_TOKEN?>';
|
||||
$(document).ready(function () {
|
||||
@@ -475,7 +506,7 @@ if ($fiberplanpipes->type == "3") {
|
||||
foreach ($markers as $marker):
|
||||
if ($counter > 0) echo ',';
|
||||
?>
|
||||
['<?= $marker['name'] ?>', <?= $marker['gps_lat'] ?>, <?= $marker['gps_long'] ?>]
|
||||
['<?= $marker['name'] ?>', <?= $marker['gps_lat'] ?>, <?= $marker['gps_long'] ?>, '<?= $marker['type'] ?>']
|
||||
<?php
|
||||
$lat = $lat + $marker['gps_lat'];
|
||||
$long = $long + $marker['gps_long'];
|
||||
@@ -486,43 +517,70 @@ if ($fiberplanpipes->type == "3") {
|
||||
|
||||
?>
|
||||
];
|
||||
console.log(locations);
|
||||
var startlat = <?=$lat ?>;
|
||||
var startlong = <?=$long ?>;
|
||||
console.log('<?=$lat . " " . $long ?>')
|
||||
|
||||
$('#pipemap').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
map.remove();
|
||||
map = L.map('map').setView([51.505, -0.09], 13);
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19
|
||||
L.tileLayer('https://mapsneu.wien.gv.at/basemap/{id}/normal/google3857/{z}/{y}/{x}.{imgtype}', {
|
||||
maxZoom: 19,
|
||||
id: "geolandbasemap",
|
||||
imgtype: "png"
|
||||
}).addTo(map);
|
||||
var icon_name = "town";
|
||||
var icon_color = "#ec98a2";
|
||||
var icon = L.MakiMarkers.icon({icon: icon_name, color: icon_color, size: "l"});
|
||||
var oldlat;
|
||||
var oldlong;
|
||||
map.setView([startlat, startlong], 14)
|
||||
for (var i = 0; i < locations.length; i++) {
|
||||
marker = new L.marker([locations[i][1], locations[i][2]]).addTo(map)
|
||||
.bindPopup(locations[i][0]);
|
||||
|
||||
if (oldlong) {
|
||||
polylinec = [
|
||||
[oldlat, oldlong],
|
||||
[locations[i][1], locations[i][2]]
|
||||
];
|
||||
polyline = L.polyline(polylinec, {color: 'red'}).addTo(map);
|
||||
polyline = null;
|
||||
console.log(polylinec);
|
||||
for (var i = 0; i < locations.length; i++) {
|
||||
if (locations[i][1]) {
|
||||
if (locations[i][3] == "Greenfield") {
|
||||
icon_name = "garden";
|
||||
icon_color = "#abbaf0";
|
||||
} else if (locations[i][3] == "Pop") {
|
||||
icon_name = "village";
|
||||
icon_color = "#acf0ab";
|
||||
} else if (locations[i][3] == "Building") {
|
||||
icon_name = "home";
|
||||
icon_color = "#f0abab";
|
||||
} else {
|
||||
icon_name = "home";
|
||||
icon_color = "#e9f0ab";
|
||||
}
|
||||
|
||||
icon = L.MakiMarkers.icon({icon: icon_name, color: icon_color, size: "l"});
|
||||
|
||||
marker.push(L.marker([locations[i][1], locations[i][2]], {icon: icon}).addTo(map).bindPopup(locations[i][0]));
|
||||
|
||||
if (oldlong) {
|
||||
polylinec = [
|
||||
[oldlat, oldlong],
|
||||
[locations[i][1], locations[i][2]]
|
||||
];
|
||||
polyline = L.polyline(polylinec, {color: 'red'}).addTo(map);
|
||||
polyline = null;
|
||||
}
|
||||
oldlong = locations[i][2];
|
||||
oldlat = locations[i][1];
|
||||
} else {
|
||||
oldlong = null;
|
||||
oldlat = null;
|
||||
|
||||
}
|
||||
oldlong = locations[i][2];
|
||||
oldlat = locations[i][1];
|
||||
}
|
||||
if (locations.length > 1) {
|
||||
fitmap = 1;
|
||||
}
|
||||
|
||||
});
|
||||
$('#pipemap').on('shown.bs.modal', function (event) {
|
||||
map.invalidateSize();
|
||||
var group = new L.featureGroup(marker);
|
||||
map.fitBounds(group.getBounds());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user