Skip to content

Commit fa6685d

Browse files
committed
adding focus also on click
1 parent 0372b00 commit fa6685d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/map-components/InventorySource.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ const InventoryLayer: React.FC = () => {
162162
// Click handler
163163
map.current.on("click", "inventory", (e: MapLayerMouseEvent) => {
164164
if (e.features && e.features.length > 0) {
165+
// console.log(e.features[0]);
165166
// get the first feature
166167
const f = e.features[0] as GeoJSON.Feature<GeoJSON.Point>;
167168
history.push(`/list/${(f as InventoryFeature).properties.treeid}`);
169+
setSelectedInventoryTreeIDHandler(f.properties?.treeid.toString());
168170
}
169171
});
170172
}, [map, src, history]);
@@ -192,8 +194,8 @@ const InventoryLayer: React.FC = () => {
192194
["==", ["get", "treeid"], selectedInventoryTreeID],
193195
// increase the radius when the feature's id matches selectedInventoryTreeID
194196
activeVariable === "height"
195-
? ["/", ["get", activeVariable], 1]
196-
: ["*", ["get", activeVariable], 100],
197+
? ["/", ["get", activeVariable], 1.9]
198+
: ["*", ["get", activeVariable], 55],
197199
// original radius calculation
198200
activeVariable === "height"
199201
? ["/", ["get", activeVariable], 2]

0 commit comments

Comments
 (0)