diff --git a/src/KartaPage.tsx b/src/KartaPage.tsx index eb79d94..f1b29ed 100644 --- a/src/KartaPage.tsx +++ b/src/KartaPage.tsx @@ -1,7 +1,7 @@ import { Paper, Flex, ScrollArea, Autocomplete } from '@mantine/core'; import { ArticleCardVertical } from './ArticleCard'; import articleCard from './assets/card.json'; -import Map from 'react-map-gl/maplibre'; +import Map, {Source, Layer} from 'react-map-gl/maplibre'; import mapstyle from './assets/basemap.json'; import { useState, useEffect } from 'react'; import Fuse from 'fuse.js' @@ -37,7 +37,7 @@ export function KartaPage() { // ignoreFieldNorm: false, // fieldNormWeight: 1, keys: [ - "attributes.title" + "attributes.tags.value" ] }; @@ -61,7 +61,22 @@ export function KartaPage() { height: '90vh' }} mapStyle={mapstyle} - /> + > + + a.id)]} + /> + + + {articles !== null && articles.length > 0 && articles.map(article => { const articleInfo = { - "image": article.attributes.cover.data !== null ? "http://strapi.wg.gateway.ts" + article.attributes.cover.data.attributes.url : "https://images.unsplash.com/photo-1628890923662-2cb23c2e0cfe?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80", + // "image": article.attributes.cover.data !== null ? "http://strapi.wg.gateway.ts" + article.attributes.cover.data.attributes.url : "https://images.unsplash.com/photo-1628890923662-2cb23c2e0cfe?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80", "category": "technology", "title": article.attributes.title, "date": new Date(article.attributes.publishedAt).toLocaleDateString("ru-RU"), @@ -108,13 +123,6 @@ export function KartaPage() { )} - {/* - - - - - - */}