Allow clicks on cells without sources
This commit is contained in:
parent
e2549f0317
commit
0bb055b391
1 changed files with 31 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ class MapAggregate extends HTMLElement {
|
|||
'fill-color': '#0dcaf0'
|
||||
}
|
||||
});
|
||||
map.addInteraction("tegola-click-interaction", {
|
||||
map.addInteraction("tegola-click-mosquito-source", {
|
||||
type: "click",
|
||||
target: { layerId: "mosquito_source" },
|
||||
handler: (e) => {
|
||||
|
|
@ -147,6 +147,36 @@ class MapAggregate extends HTMLElement {
|
|||
}));
|
||||
}
|
||||
});
|
||||
map.addInteraction("tegola-click-service-request", {
|
||||
type: "click",
|
||||
target: { layerId: "service_request" },
|
||||
handler: (e) => {
|
||||
const coordinates = e.feature.geometry.coordinates.slice();
|
||||
const properties = e.feature.properties;
|
||||
this.dispatchEvent(new CustomEvent("cell-click", {
|
||||
bubbles: true,
|
||||
composed: true, // Allows event to cross shadow DOM boundary
|
||||
detail: {
|
||||
cell: properties.cell
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
map.addInteraction("tegola-click-trap", {
|
||||
type: "click",
|
||||
target: { layerId: "trap" },
|
||||
handler: (e) => {
|
||||
const coordinates = e.feature.geometry.coordinates.slice();
|
||||
const properties = e.feature.properties;
|
||||
this.dispatchEvent(new CustomEvent("cell-click", {
|
||||
bubbles: true,
|
||||
composed: true, // Allows event to cross shadow DOM boundary
|
||||
detail: {
|
||||
cell: properties.cell
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue