import React, { Fragment, useState, useEffect, useRef } from "react"; // @ts-ignore import { mapboxgl, LngLatLike } from '!mapbox-gl'; // eslint-disable-line import/no-webpack-loader-syntax import { MAPBOX_ACCESS_TOKEN, IMAGE_COORDINATES, IMAGES_BASE_URL } from "./config"; import "mapbox-gl/dist/mapbox-gl.css"; interface MapProps { slider: number, images: string[], } function Map({ slider, images }: MapProps) { const mapContainer = useRef(null); const map = useRef(null); const [center] = useState([35, 31.9]); const [zoom] = useState([6.3]); useEffect(() => { if (map.current) return; // initialize map only once map.current = new mapboxgl({ accessToken: MAPBOX_ACCESS_TOKEN, container: mapContainer.current, style: 'mapbox://styles/mapbox/streets-v11', center, zoom, minZoom: 5, maxZoom: 10, hash: false, }); }); return (
); // return ( // // {images.map((img, i) => { // const id = `radar-280-${i}`; // return ( // // {/* // */} // // ); // })} // // ); } export default Map;