|
|
|
@ -6,10 +6,11 @@ import {
|
|
|
|
import { XMarkIcon } from "@heroicons/react/24/outline";
|
|
|
|
import { XMarkIcon } from "@heroicons/react/24/outline";
|
|
|
|
import { Fragment, useRef, useState } from "react";
|
|
|
|
import { Fragment, useRef, useState } from "react";
|
|
|
|
|
|
|
|
|
|
|
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
|
|
|
|
|
|
import Map, { Layer, Popup, ScaleControl, Source } from "react-map-gl/maplibre";
|
|
|
|
import Map, { Layer, Popup, ScaleControl, Source } from "react-map-gl/maplibre";
|
|
|
|
|
|
|
|
import basemap from "./assets/basemap.json";
|
|
|
|
import mapstyle from "./countries.json";
|
|
|
|
import mapstyle from "./countries.json";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mapstyle.sources.remap.url = import.meta.env.MODE === "development" ? "http://localhost:8080/capabilities/remap.json" : mapstyle.sources.remap.url
|
|
|
|
mapstyle.sources.remap.url = import.meta.env.MODE === "development" ? "http://localhost:8080/capabilities/remap.json" : mapstyle.sources.remap.url
|
|
|
|
|
|
|
|
|
|
|
|
const paintedLayers = mapstyle.layers.reduce((acc, cur) => ({ ...acc, [cur.id]: cur }), {})
|
|
|
|
const paintedLayers = mapstyle.layers.reduce((acc, cur) => ({ ...acc, [cur.id]: cur }), {})
|
|
|
|
@ -620,13 +621,15 @@ export default function Countries({ mapOptions, onMapOptionClick }) {
|
|
|
|
longitude: mapstyle.center[1],
|
|
|
|
longitude: mapstyle.center[1],
|
|
|
|
zoom: mapstyle.zoom,
|
|
|
|
zoom: mapstyle.zoom,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
|
|
|
|
mapStyle={basemap}
|
|
|
|
minZoom={mapstyle.minZoom}
|
|
|
|
minZoom={mapstyle.minZoom}
|
|
|
|
maxZoom={mapstyle.maxZoom}
|
|
|
|
|
|
|
|
ref={mapRef}
|
|
|
|
ref={mapRef}
|
|
|
|
interactiveLayerIds={["power_fact_mw"]}
|
|
|
|
interactiveLayerIds={["power_fact_mw"]}
|
|
|
|
onClick={handleClick}
|
|
|
|
onClick={handleClick}
|
|
|
|
onMouseEnter={handleMouseEnter}
|
|
|
|
onMouseEnter={handleMouseEnter}
|
|
|
|
onMouseLeave={handleMouseLeave}
|
|
|
|
onMouseLeave={handleMouseLeave}
|
|
|
|
|
|
|
|
maxZoom={6}
|
|
|
|
|
|
|
|
hash
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
{open && <Popup
|
|
|
|
{open && <Popup
|
|
|
|
|