diff --git a/src/components/maps/AreaInfoHover.tsx b/src/components/maps/AreaInfoHover.tsx index 20fc748a8..be662434a 100644 --- a/src/components/maps/AreaInfoHover.tsx +++ b/src/components/maps/AreaInfoHover.tsx @@ -8,9 +8,8 @@ import { SelectedPolygon } from './AreaActiveMarker' * Area info panel */ export const AreaInfoHover: React.FC = ({ data, geometry, mapInstance }) => { - const parent = data?.parent == null ? null : JSON.parse(data.parent) - const parentName = parent?.name ?? 'Unknown' - const parentId = parent?.id ?? null + const ancestors = data?.ancestors == null ? null : JSON.parse(data.ancestors) + const pathTokens = data?.pathTokens == null ? null : JSON.parse(data.pathTokens) let screenXY if (geometry.type === 'Point') { @@ -18,6 +17,9 @@ export const AreaInfoHover: React.FC = ({ data, geometry, mapInstance } else { return } + + const parentId = ancestors?.[ancestors.length - 2] ?? null + const parentName = pathTokens?.[pathTokens.length - 2] ?? 'Unknown' return ( @@ -34,10 +36,10 @@ export const Content: React.FC - {parentName} + {parentName} ) return ( diff --git a/src/components/maps/GlobalMap.tsx b/src/components/maps/GlobalMap.tsx index 281e48429..016f05278 100644 --- a/src/components/maps/GlobalMap.tsx +++ b/src/components/maps/GlobalMap.tsx @@ -96,13 +96,13 @@ export const GlobalMap: React.FC = ({ showFullscreenControl = tr } }, [mapInstance]) - useEffect(() => { - const protocol = new Protocol() - maplibregl.addProtocol('pmtiles', protocol.tile) - return () => { - maplibregl.removeProtocol('pmtiles') - } - }, []) + // useEffect(() => { + // const protocol = new Protocol() + // maplibregl.addProtocol('pmtiles', protocol.tile) + // return () => { + // maplibregl.removeProtocol('pmtiles') + // } + // }, []) return (
diff --git a/src/components/maps/OBCustomLayers.tsx b/src/components/maps/OBCustomLayers.tsx index 3eeaec35e..f4d7ccf1d 100644 --- a/src/components/maps/OBCustomLayers.tsx +++ b/src/components/maps/OBCustomLayers.tsx @@ -27,9 +27,9 @@ export const OBCustomLayers: React.FC = () => { 'text-size': 12, 'text-font': ['Open Sans Regular', 'Arial Unicode MS Regular'], 'icon-image': 'circle', - 'icon-size': ['interpolate', ['linear'], ['zoom'], 8, 0.25, 16, 1], - 'text-variable-anchor': ['bottom', 'left', 'right'], - 'text-radial-offset': 0.5 + 'icon-size': ['interpolate', ['linear'], ['zoom'], 8, 0.25, 18, 1], + 'text-variable-anchor': ['bottom', 'top', 'left', 'right'], + 'text-radial-offset': ['interpolate', ['linear'], ['zoom'], 6, 0.25, 16, 1] }} paint={{ 'icon-color': '#111827',