Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"storybook": "^9.0.0",
"svelte": "^5.23.0",
"svelte-check": "^4.0.0",
"svelte-preprocess": "^6.0.3",
"typescript": "^5.8.3",
"vite": "^6.0.0",
"vitest": "^3.1.1",
Expand Down
22 changes: 0 additions & 22 deletions components/src/maplibre/AttributionControl/AttributionControl.css

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import maplibre, { type ControlPosition } from 'maplibre-gl';
import MapControl from '../MapControl/MapControl.svelte';
import './AttributionControl.css';

interface AttributionControlProps {
position?: ControlPosition;
Expand All @@ -17,3 +16,30 @@
compact: false
})}
/>

<style lang="scss">
:global {
.maplibregl-ctrl.maplibregl-ctrl-attrib {
font-size: var(--fs-small-3);
letter-spacing: 0.005em;
word-spacing: 0.005em;
font-family: var(--swr-sans);
}
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
display: block;
}
.maplibregl-ctrl-attrib-button {
display: none;
}

.maplibregl-ctrl-attrib a {
color: inherit;
text-decoration: none;
text-underline-offset: 0.2em;
}
.maplibregl-ctrl-attrib a:hover {
color: inherit;
text-decoration: underline;
}
}
</style>
144 changes: 0 additions & 144 deletions components/src/maplibre/GeocoderControl/GeocoderControl.css

This file was deleted.

150 changes: 149 additions & 1 deletion components/src/maplibre/GeocoderControl/GeocoderControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { MaptilerGeocoderAPI } from './GeocoderAPIs';
import MapControl from '../MapControl/MapControl.svelte';
import { type GeocodingCountry, type GeocodingLanguage, type GeocodingService } from '../types';
import './GeocoderControl.css';

interface GeocoderControlProps {
service: GeocodingService;
Expand Down Expand Up @@ -58,3 +57,152 @@
</script>

<MapControl control={geocoder} position="top-left" />

<style lang="scss">
:global {
.maplibregl-ctrl-geocoder {
background-color: #fff;
position: relative;
width: 100%;
z-index: 1;
font-family: var(--swr-sans);
font-size: var(--fs-small-1);
border-radius: var(--br-small);
border: 1px solid rgba(0, 0, 0, 0.75);
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.075);
}

.maplibre-gl-geocoder--error {
font-size: var(--fs-small-2);
color: var(--gray-dark-2);
padding: 0.4em 0.65em;
}

.maplibregl-ctrl-geocoder--input {
width: calc(100% - 3.7em);
height: 100%;
font-family: inherit;
font-size: inherit;
background-color: transparent;
color: var(--gray-dark-5);
border: 0;
height: 1.85em;
padding: 0 1.85em;
padding-top: 0.1em;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}

.maplibregl-ctrl-geocoder--input::placeholder {
opacity: 1;
color: var(--gray-dark-2);
}
.maplibregl-ctrl-geocoder--input:focus {
color: var(--gray-dark-5);
outline: 0;
}

.maplibregl-ctrl-geocoder .maplibregl-ctrl-geocoder--pin-right > * {
display: none;
position: absolute;
z-index: 2;
right: 0.5em;
top: 50%;
transform: translateY(-50%);
border: 0;
}

/* Suggestions */
.maplibregl-ctrl-geocoder .suggestions {
background: white;
border: 1px solid rgba(0, 0, 0, 0.75);
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
border-radius: var(--br-small);
left: 0;
list-style: none;
position: absolute;
width: 100%;
top: calc(100% + 0.5em);
z-index: 1000;
overflow: hidden;
}

.maplibregl-ctrl-bottom-left .suggestions,
.maplibregl-ctrl-bottom-right .suggestions {
top: auto;
bottom: 100%;
}

.maplibregl-ctrl-geocoder .suggestions > li > a {
cursor: default;
display: block;
padding: 0.5em 0.75em;
color: var(--gray-dark-5);
padding-bottom: 0.5em;
border-bottom: 1px solid var(--gray-light-3);
}
.maplibregl-ctrl-geocoder .suggestions > li:last-child > a {
border-bottom: 0;
}

.maplibregl-ctrl-geocoder .suggestions > .active > a,
.maplibregl-ctrl-geocoder .suggestions > li > a:hover {
background: var(--gray-light-5);
text-decoration: none;
cursor: pointer;
}
.maplibregl-ctrl-geocoder .suggestions > .active .maplibregl-ctrl-geocoder--result-title,
.maplibregl-ctrl-geocoder .suggestions > li > a:hover .maplibregl-ctrl-geocoder--result-title {
text-decoration: underline;
}

.maplibregl-ctrl-geocoder--suggestion {
display: flex;
flex-direction: row;
align-items: center;
}

.maplibregl-ctrl-geocoder--suggestion-info {
display: flex;
flex-direction: column;
}

.maplibregl-ctrl-geocoder--suggestion-title,
.maplibregl-ctrl-geocoder--suggestion-address,
.maplibregl-ctrl-geocoder--result-address {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.maplibregl-ctrl-geocoder--result-icon {
display: none;
}
.maplibregl-ctrl-geocoder--result-title {
font-weight: 600;
letter-spacing: 0;
}
.maplibregl-ctrl-geocoder--result-address {
font-size: var(--fs-small-2);
color: var(--gray-dark-2);
line-height: 1.3;
}

.maplibregl-ctrl-geocoder--icon {
display: inline-block;
position: absolute;
top: 50%;
transform: translateY(-50%);
height: 1em;
}

.maplibregl-ctrl-geocoder--icon-close {
right: 0;
}
.maplibregl-ctrl-geocoder--icon-search {
left: 0.5em;
height: 1.5em;
}
}
</style>
Loading