fix map build

This commit is contained in:
Sacha Weatherstone
2022-08-27 19:58:29 +09:30
parent 078d49f56e
commit d72a859f39
+23 -26
View File
@@ -57,16 +57,15 @@ export const MapPage = (): JSX.Element => {
marginLeft="auto"
size="small"
onClick={() => {
console.log("clicked");
console.log(map);
map?.flyTo({
center: [
n.data.position?.latitudeI / 1e7,
n.data.position?.longitudeI / 1e7,
],
zoom: 10,
});
if (n.data.position?.latitudeI) {
map?.flyTo({
center: [
n.data.position.longitudeI / 1e7,
n.data.position.latitudeI / 1e7,
],
zoom: 10,
});
}
}}
/>
</Pane>
@@ -90,22 +89,20 @@ export const MapPage = (): JSX.Element => {
</Pane>
</Marker>
))}
{nodes
.filter((n) => n.data.position?.latitudeI)
.map((n) => {
if (n.data.position?.latitudeI) {
return (
<Marker
key={n.data.num}
longitude={n.data.position.longitudeI / 1e7}
latitude={n.data.position.latitudeI / 1e7}
anchor="bottom"
>
<Hashicon value={n.data.num.toString()} size={32} />
</Marker>
);
}
})}
{nodes.map((n) => {
if (n.data.position?.latitudeI) {
return (
<Marker
key={n.data.num}
longitude={n.data.position.longitudeI / 1e7}
latitude={n.data.position.latitudeI / 1e7}
anchor="bottom"
>
<Hashicon value={n.data.num.toString()} size={32} />
</Marker>
);
}
})}
</Map>
</Pane>
);