-
-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hey!
I am trying to select a Polygon overlapping other. As a result I got both triggered. How can I trigger just the small one?
const handleInternalClick = (e) => {
console.log("internal");
};
const handleExternalClick = (e) => {
console.log("external");
};
<React.Fragment>
<RMap
className="example-map"
initial={{ center: fromLonLat(coords.origin), zoom: 9 }}
>
<ROSM />
<RLayerVector zIndex={10}>
<RFeature
geometry={
new Polygon([
[
fromLonLat(coords.PlaceDItalie),
fromLonLat(coords.Bastille),
fromLonLat(coords.point),
fromLonLat(coords.TourEiffel),
],
])
}
onClick={handleExternalClick}
>
<RStyle>
<RStroke color="yellow" width={4} />
<RFill color="#FFFf004D" />
</RStyle>
<RFeature geometry={new Point(fromLonLat(coords.Montmartre))}>
<RStyle>
<RIcon src={locationIcon} />
</RStyle>
</RFeature>
</RFeature>
<RLayerVector zIndex={100}>
<RFeature
geometry={
new Polygon([
[
fromLonLat(internalCoords.coord1),
fromLonLat(internalCoords.coord2),
fromLonLat(internalCoords.coord3),
fromLonLat(internalCoords.coord4),
fromLonLat(internalCoords.coord5),
fromLonLat(internalCoords.coord6),
],
])
}
onClick={handleInternalClick}
>
<RStyle>
<RStroke color="red" width={4} />
<RFill color="#d1001f4D" />
</RStyle>
</RFeature>
</RLayerVector>
</RLayerVector>
</RMap>
</React.Fragment>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
