Skip to content

Commit

Permalink
Carte exploration : couleur layer ZFE (#4015)
Browse files Browse the repository at this point in the history
* Carte exploration : couleur layer ZFE

* Fix typo

Co-authored-by: Frédéric Menou <[email protected]>

---------

Co-authored-by: Frédéric Menou <[email protected]>
Co-authored-by: Thibaut Barrère <[email protected]>
  • Loading branch information
3 people authored Jul 1, 2024
1 parent 7567980 commit b6a7e5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions apps/transport/client/javascripts/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ function updateIRVELayer (geojson) {

function trackEvent (layer) {
// https://matomo.org/faq/reports/implement-event-tracking-with-matomo/#how-to-set-up-matomo-event-tracking-with-javascript
window._paq.push(['trackEvent', 'explore-map', 'enable-layer', layer])
// `window._paq` is only defined in production (in templates/layout/app.html.heex)
if (window._paq) {
window._paq.push(['trackEvent', 'explore-map', 'enable-layer', layer])
}
}

function createPointsLayer (geojson, id) {
const fillColor = {
'bnlc-layer': [255, 174, 0, 100],
'parkings_relais-layer': [0, 33, 70, 100],
'zfe-layer': [155, 89, 182, 100],
'zfe-layer': [52, 8, 143, 100],
'irve-layer': [245, 40, 145, 100]
}[id]

Expand All @@ -192,6 +195,7 @@ function createPointsLayer (geojson, id) {
filled: true,
extruded: false,
pointType: 'circle',
opacity: 1,
getFillColor: fillColor,
getPointRadius: 1000,
pointRadiusUnits: 'meters',
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/client/stylesheets/components/_explore.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
background-color: rgb(0, 33, 70);
}
#zfe-check:checked {
background-color: rgb(155, 89, 182);
background-color: rgb(52, 8, 143);
}
#irve-check:checked {
background-color: rgb(245, 40, 145);
Expand Down

0 comments on commit b6a7e5d

Please sign in to comment.