Poprawka w url, pierwsza wersja boxa z listą miejscowości
This commit is contained in:
46
src/components/maps/CitiesList.astro
Normal file
46
src/components/maps/CitiesList.astro
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
const { cities = [] } = Astro.props;
|
||||
|
||||
// sortujemy alfabetycznie
|
||||
const sorted = cities.sort((a: string, b: any) => a.localeCompare(b, "pl"));
|
||||
---
|
||||
|
||||
<div class="fuz-">
|
||||
<h4 class="fuz-cities-title">Miejscowości w zasięgu sieci światłowodowej lub radiowej</h4>
|
||||
|
||||
<div class="fuz-cities-grid">
|
||||
{sorted.map((city: unknown) => (
|
||||
<span class="fuz-city-item">{city}</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.fuz-cities-box {
|
||||
margin-top: 20px;
|
||||
background: var(--fuz-bg);
|
||||
color: var(--fuz-text);
|
||||
border: 1px solid var(--fuz-border, #ddd);
|
||||
padding: 16px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.fuz-cities-title {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.fuz-cities-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
|
||||
gap: 6px 14px;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.fuz-city-item {
|
||||
color: var(--fuz-text);
|
||||
}
|
||||
</style>
|
||||
@@ -3,13 +3,15 @@ import DefaultLayout from "../../layouts/DefaultLayout.astro";
|
||||
import MapGoogle from "../../components/maps/MapGoogle.astro";
|
||||
import MapRangeSwitch from "../../islands/MapRangeSwitch.jsx";
|
||||
import RangeForm from "../../islands/RangeForm.jsx";
|
||||
import CitiesList from "../../components/maps/CitiesList.astro";
|
||||
|
||||
import "../../styles/map-google.css";
|
||||
|
||||
const apiKey = import.meta.env.PUBLIC_GOOGLE_MAPS_KEY;
|
||||
const lat = 52.597388;
|
||||
const lon = 21.456797;
|
||||
const mapStyleId = "8e0a97af9476f2d3";
|
||||
const res = await fetch(Astro.url.origin + "/api/all-cities");
|
||||
const res = await fetch(new URL("/api/all-cities", Astro.url));
|
||||
const cities = await res.json();
|
||||
---
|
||||
|
||||
@@ -59,6 +61,7 @@ const cities = await res.json();
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- <CitiesList cities={cities} /> -->
|
||||
<!-- ===================================================== -->
|
||||
<!-- WARSTWY KML -->
|
||||
<!-- ===================================================== -->
|
||||
|
||||
Reference in New Issue
Block a user