Skip to content

Commit

Permalink
multifeature without colours will display in Navy
Browse files Browse the repository at this point in the history
  • Loading branch information
aloxe committed Jul 12, 2024
1 parent 171ca8e commit 7bf70e9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/components/MainMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,26 @@ const MainMap = ({geojsonList, tileName, handleClickPopup, currentGeoJson}) => {
data={geojson}
styleCallback={(feature) => {
if (feature?.geometry?.type === "Point") {
// removing ugly display for points. Points still triggers some bug in zoom and page positionning
// TODO: track issue
// use patch-package to update pigeon-maps
// removing display for points.
return { strokeWidth: "0", stroke: "black", r: '0', };
}
if (geojson.features.length > 1) { // rainbow colours for multi paths geojson
return {
strokeWidth: "2",
stroke: feature.properties.color,
strokeLinejoin: 'round',
opacity: '0.8',
};
}
if (geojson.url === currentGeoJson?.url) {
if (geojson.url === currentGeoJson?.url) { // sellected path
if (geojson.features.length > 1) { // rainbow colours for multi paths geojson
return {
strokeWidth: "4",
stroke: 'MediumBlue',
stroke: feature.properties.color || "Navy",
strokeLinejoin: 'round',
opacity: '1',
};
}
return {
strokeWidth: "4",
stroke: 'MediumBlue',
strokeLinejoin: 'round',
opacity: '1',
};
}
return {
strokeWidth: "3",
stroke: 'red',
strokeLinejoin: 'round',
Expand Down

0 comments on commit 7bf70e9

Please sign in to comment.