Skip to content
Snippets Groups Projects
Commit 23d3fa02 authored by Miguel Angelo Salerno's avatar Miguel Angelo Salerno
Browse files

fix map marker label

parent 5d1dbb62
Branches
No related tags found
1 merge request!54Homologa
......@@ -35,7 +35,7 @@ function CircleMarkerComponent(props) {
const refMarker = useRef();
const refPopup = useRef();
const { education, loading, locationBuildingId, clickedSchool, setClickedSchool } = props;
const { education, loading, locationBuildingId, clickedSchool, setClickedSchool, path } = props;
useEffect(() => {
if (refPopup.current !== null) {
......@@ -68,7 +68,12 @@ function CircleMarkerComponent(props) {
<Marker riseOnHover ref={refMarker} position={props.pos} icon={circleIcon}>
<Popup ref={refPopup} className="popup-container" onOpen={onPopupOpen} onClose={onPopupClose}>
{props.name} <br/>
{isNaN(props.percent) ? 'Não Disponível' : Math.round(props.percent) + (education === 'basic' ? '%' : '')}
{
isNaN(props.percent) ? 'Não Disponível' : Math.round(props.percent) +
(education === 'basic' ?
(path[4] === 'nivel_formacao_docente' ? '' : '%') :
'')
}
</Popup>
</Marker>
)
......
......@@ -440,13 +440,21 @@ function MapComponent(props) {
/>
{filteredSchoolLocation.map(schoolLocation => {
var education = indicador.education === 'basic' ? 'percent' : 'total'
if (path[4] === 'nivel_formacao_docente') {
education = 'total'
}
const value = getFieldValue(
locationBuildingFormationPercent,
indicador.locationBuilding + '_id',
schoolLocation.id,
indicador.education === 'basic' ? 'percent' : 'total'
education
)
console.log('value: ', value)
const color = getColor(
locationBuildingFormationPercent,
indicador.locationBuilding + '_id',
......@@ -465,6 +473,7 @@ function MapComponent(props) {
setClickedSchool={sc => updateFilters(indicador.locationBuilding, sc, true)}
color={color ?? (indicador.education === 'basic' ? '#FECB3B' : '#F18325')}
percent={value ?? 0}
path={path}
/>
)
})}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment