Added FttxLocation ex state circles to PreorderMap
This commit is contained in:
@@ -1370,6 +1370,7 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
|
||||
var preorderMap;
|
||||
var preorders = [];
|
||||
var fttxlocations = [];
|
||||
var markers = [];
|
||||
var markerState = true;
|
||||
var mapCenterPos = [<?=TT_PLACEHOLDER_GPS_LAT?>, <?=TT_PLACEHOLDER_GPS_LONG?>];
|
||||
@@ -1536,6 +1537,7 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
|
||||
//fetch fcps and show on map
|
||||
getFCPs(preorderMap);
|
||||
addFttxLocations(preorderMap);
|
||||
|
||||
// calculate center position
|
||||
mapCenterPos = GetCenterFromDegrees(all_coords);
|
||||
@@ -1614,6 +1616,29 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
});
|
||||
}
|
||||
|
||||
function addFttxLocations(preorderMap) {
|
||||
fttx_c = {
|
||||
"gross planning": "grey",
|
||||
"detailed planning": "yellow",
|
||||
"plan released": "deeppink",
|
||||
"assigend": "aqua",
|
||||
"executed": "darkblue",
|
||||
"documented": "lime",
|
||||
"canceled": "darkred",
|
||||
};
|
||||
|
||||
fttxlocations.forEach(loc => {
|
||||
if(!loc.gps_lat || !loc.gps_long || !loc.ex_state) return;
|
||||
|
||||
var circle = L.circleMarker([loc.gps_lat, loc.gps_long], {
|
||||
color: fttx_c[loc.ex_state.toLowerCase()],
|
||||
fillColor: fttx_c[loc.ex_state.toLowerCase()],
|
||||
fillOpacity: .8,
|
||||
radius: 6
|
||||
}).bindTooltip(loc.street + "<br />" + loc.zip + " " + loc.city + "<br /><br />Execution State: " + loc.ex_state).addTo(preorderMap);
|
||||
})
|
||||
}
|
||||
|
||||
function centerMap() {
|
||||
preorderMap.setView(mapCenterPos, 12);
|
||||
}
|
||||
@@ -1624,19 +1649,25 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
|
||||
$.post('<?=self::getUrl("Preorder", "Api")?>', {
|
||||
'do': "getFilteredPreorders",
|
||||
filter: filter
|
||||
filter: filter,
|
||||
},function(success) {
|
||||
if(success.status == "OK") {
|
||||
|
||||
changes = false;
|
||||
if(Array.isArray(success.result.preorders)) {
|
||||
preorders = success.result.preorders;
|
||||
changes = true;
|
||||
}
|
||||
if(Array.isArray(success.result.fttxlocations))
|
||||
fttxlocations = success.result.fttxlocations;
|
||||
changes = true;
|
||||
}
|
||||
|
||||
if(changes) {
|
||||
renderMap();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
'json'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function getFilter() {
|
||||
|
||||
Reference in New Issue
Block a user