Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ELC_elections
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gestion-des-assemblees
ELC_elections
Commits
a756894b
Commit
a756894b
authored
4 years ago
by
Alexis POYEN
Browse files
Options
Downloads
Patches
Plain Diff
Feat : display sections results at map init
parent
29ce3e65
No related branches found
No related tags found
2 merge requests
!74
Resolve "Color the map"
,
!72
Resolve "Color the map"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/components/visualization/results-map.js
+21
-2
21 additions, 2 deletions
web/components/visualization/results-map.js
with
21 additions
and
2 deletions
web/components/visualization/results-map.js
+
21
−
2
View file @
a756894b
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment