Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3b80b02
Merge remote-tracking branch 'upstream/main' into 1291_map_to_events_…
nicki182 May 31, 2025
243b25f
chore: created new components and refactor
nicki182 Jun 7, 2025
d3378d2
chore: created new components and refactor
nicki182 Jun 7, 2025
ca1b226
Merge remote-tracking branch 'origin/1291_map_to_events_page' into 12…
nicki182 Jun 7, 2025
5ba2682
fix: cluster and pointers are showing
nicki182 Jun 7, 2025
078c897
chore: refacor sidebar and change folder structure
nicki182 Jun 7, 2025
ecea5bf
chore: form view selector refactor
nicki182 Jun 8, 2025
dbb0f8e
fix: change selector when clicked new option
nicki182 Jun 9, 2025
1db0806
chore: added new views with selector
nicki182 Jun 9, 2025
89937a0
fix: default view type when first load
nicki182 Jun 9, 2025
18865fa
Minor edits to contributing guide to add i18n-check usage guide
andrewtavis Jun 19, 2025
67bf9c4
Minor change to docs header and don't include formatting in dependenc…
andrewtavis Jun 20, 2025
75e7ed5
chore: created new components and refactor
nicki182 Jun 7, 2025
4869def
fix: cluster and pointers are showing
nicki182 Jun 7, 2025
1ddb5e9
chore: refacor sidebar and change folder structure
nicki182 Jun 7, 2025
50874f1
chore: form view selector refactor
nicki182 Jun 8, 2025
64cb5c1
fix: change selector when clicked new option
nicki182 Jun 9, 2025
59c65b2
fix: default view type when first load
nicki182 Jun 9, 2025
7ee5df6
fix: fix bug to view tootil in poiter and view default in events fix
nicki182 Jun 20, 2025
961c984
Merge remote-tracking branch 'refs/remotes/origin/1291_map_to_events_…
nicki182 Jun 20, 2025
6708081
fix: add missing header
nicki182 Jun 21, 2025
94420d8
fix: eliminated unnesary foldder and files
nicki182 Jun 21, 2025
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
Prev Previous commit
Next Next commit
fix: cluster and pointers are showing
  • Loading branch information
nicki182 committed Jun 20, 2025
commit 4869def792eb36740d3449f61ed45ec92713a7ff
133 changes: 0 additions & 133 deletions frontend/components/media/MediaMap.vue

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/components/media/map/MediaMapEvents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ const pointers: PointerCluster[] = events.map((event) => {
});
const clusterProperties: ClusterProperties = {
cluster: {
value_1: {
learn: {
logic: ["+", ["case", ["==", ["get", "type"], "learn"], 1, 0]],
color: colorByType.learn,
},
value_2: {
action: {
color: colorByType.action,
logic: ["+", ["case", ["==", ["get", "type"], "action"], 1, 0]],
},
Expand Down
24 changes: 12 additions & 12 deletions frontend/composables/useClusterMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export const useClusterMap = () => {
clusterProperties: ClusterProperties
) => {
const newMarkers: { [key: string]: maplibregl.Marker } = {};
const features = map.querySourceFeatures("events");

const features = map.querySourceFeatures("pointers");
console.log("Querying features for pointers:", features);
// Add this at the top of your updateMarkers function.
const currentZoom = map.getZoom();

Expand All @@ -132,7 +132,7 @@ export const useClusterMap = () => {
if (geometry.type === "Point") {
const coords = geometry.coordinates as [number, number];
const props = features[i].properties;

console.log("Processing feature:", props, coords);
if (props.cluster) {
// Cluster handling with zoom-based declustering.
const id = props.cluster_id;
Expand Down Expand Up @@ -180,6 +180,7 @@ export const useClusterMap = () => {
if (!marker) {
const multipleDonutProps =
clusterProperties?.getMultipleDonutProps(props);
console.log("Multiple donut props:", multipleDonutProps);
console.log(multipleDonutProps, id, props, coords);
const el = createDonutChart(multipleDonutProps, id);
const popUpContent = popupCreate(props);
Expand Down Expand Up @@ -275,8 +276,8 @@ export const useClusterMap = () => {
const selectedRoute = setSelectedRoute();
map.on("load", () => {
// Cleanup existing sources/layers.
if (map.getSource("events")) {
map.removeSource("events");
if (map.getSource("pointers")) {
map.removeSource("pointers");
}
["clusters", "cluster-count", "unclustered-points"].forEach((layerId) => {
if (map.getLayer(layerId)) {
Expand All @@ -302,13 +303,12 @@ export const useClusterMap = () => {
},
})
);

const logic: { [key: string]: unknown } = {};
// Add a clustered GeoJSON source for events.
const logic = Object.keys(clusterProperties.cluster).map((key) => ({
[key]: clusterProperties.cluster[key as `value_${number}`].logic,
}));
console.log("Cluster properties logic:", logic);
map.addSource("pointer", {
Object.keys(clusterProperties.cluster).forEach(
(key) => (logic[key] = clusterProperties.cluster[key].logic)
);
map.addSource("pointers", {
type: "geojson",
data: {
type: "FeatureCollection",
Expand All @@ -323,7 +323,7 @@ export const useClusterMap = () => {
// Add a layer for unclustered points.
map.addLayer({
id: "unclustered-points",
source: "events",
source: "pointers",
type: "symbol",
filter: ["==", "id", ""], // Never matches anything.
paint: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/types/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface ClusterProperties {
getMultipleDonutProps: (values: GeoJsonProperties) => DonutProperties;
getPointerColor: (values: GeoJsonProperties) => string;
cluster: {
[key: `value_${number}`]: {
[key: string]: {
logic: unknown;
color: string;
};
Expand Down