Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Adiciona variação da linha no tooltip #132

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/contrib/frontend/maps/static/maps/js/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ if (mapWrapper) {
`<span>Empresa responsável: ${properties.ln_empresa}</span><br>` +
`<span>Viagens em 2019: ${properties.viagens_em_2019}</span><br>` +
`<span>Viagens em 2023: ${properties.viagens_em_2023}</span><br>` +
`<span>Redução: ${properties.reducao_linha}</span><br>` +
`<span>Variação da linha: ${properties.reducao_linha}%</span><br>` +
ifObsProperty
).addTo(map);
});
}

function addPolyline(coordinates, properties) {
const lineColor = mapWrapper.dataset.mapsLinecolor;
let ifObsProperty = !!properties?.observacoes ? `<span>Obs: ${properties.observacoes}</span><br>` : "";

if (polylineGeoJSON) map.removeLayer(polylineGeoJSON);

Expand All @@ -111,7 +112,11 @@ if (mapWrapper) {
layer.bindPopup(
`<span>Número: ${properties.ln_codigo}</span><br>` +
`<span>Nome: ${properties.title}</span><br>` +
`<span>Empresa responsável: ${properties.ln_empresa}</span><br>`
`<span>Empresa responsável: ${properties.ln_empresa}</span><br>` +
`<span>Viagens em 2019: ${properties.viagens_em_2019}</span><br>` +
`<span>Viagens em 2023: ${properties.viagens_em_2023}</span><br>` +
`<span>Variação da linha: ${properties.reducao_linha}%</span><br>` +
ifObsProperty
);
},
}).addTo(map);
Expand Down