Skip to content
Snippets Groups Projects
Commit a756894b authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Feat : display sections results at map init

parent 29ce3e65
No related branches found
No related tags found
2 merge requests!74Resolve "Color the map",!72Resolve "Color the map"
......@@ -80,7 +80,6 @@ class MapComponent {
}
async colorAreas(mapHandler, dataSource) {
console.log(mapHandler.parent.parent.results.areasResults);
for (let area of mapHandler.parent.parent.results.areasResults) {
if (area.status == mapHandler.parent.parent.filter) {
let party = await mapHandler.PartyModel.getParty(
......@@ -99,7 +98,27 @@ class MapComponent {
return dataSource;
}
colorSections(mapHandler, dataSource) {}
async colorSections(mapHandler, dataSource) {
mapHandler.parent.parent.results.areasResults.forEach(async (area) => {
console.log(area.Sections);
for (let section of area.Sections) {
if (section.status == mapHandler.parent.parent.filter) {
let party = await mapHandler.PartyModel.getParty(
section.candidateLists[0].PartyID
);
dataSource = mapHandler.colorTiles(
dataSource,
parseInt(section.MapID),
party.Name,
party.Color
);
} else {
dataSource = mapHandler.colorTiles(dataSource, section.MapID, "", "");
}
}
});
return dataSource;
}
colorTiles(dataSource, gid, partyName, color) {
for (let f of dataSource.features) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment