diff --git a/InitUiElements.ts b/InitUiElements.ts index 803e4aa20..a58f581cb 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -1,4 +1,3 @@ -import {CenterFlexedElement} from "./UI/Base/CenterFlexedElement"; import {FixedUiElement} from "./UI/Base/FixedUiElement"; import Toggle from "./UI/Input/Toggle"; import {Basemap} from "./UI/BigComponents/Basemap"; @@ -197,25 +196,23 @@ export class InitUiElements { State.state.currentGPSLocation, State.state.leafletMap, State.state.layoutToUse - ) + ), { + dontStyle : true + } ), undefined, State.state.featureSwitchGeolocation ); const plus = new MapControlButton( - new CenterFlexedElement( - Img.AsImageElement(Svg.plus_zoom, "", "width:1.25rem;height:1.25rem") - ) + Svg.plus_zoom_svg() ).onClick(() => { State.state.locationControl.data.zoom++; State.state.locationControl.ping(); }); const min = new MapControlButton( - new CenterFlexedElement( - Img.AsImageElement(Svg.min_zoom, "", "width:1.25rem;height:1.25rem") - ) + Svg.min_zoom_svg() ).onClick(() => { State.state.locationControl.data.zoom--; State.state.locationControl.ping(); @@ -383,9 +380,7 @@ export class InitUiElements { const filterMapControlButton = new MapControlButton( - new CenterFlexedElement( - Img.AsImageElement(Svg.filter, "", "width:1.25rem;height:1.25rem") - ) + Svg.filter_svg() ); const filterButton = new Toggle( diff --git a/Logic/Actors/GeoLocationHandler.ts b/Logic/Actors/GeoLocationHandler.ts index 4d737ac5e..169fbbaab 100644 --- a/Logic/Actors/GeoLocationHandler.ts +++ b/Logic/Actors/GeoLocationHandler.ts @@ -5,7 +5,7 @@ import Img from "../../UI/Base/Img"; import {LocalStorageSource} from "../Web/LocalStorageSource"; import LayoutConfig from "../../Customizations/JSON/LayoutConfig"; import {VariableUiElement} from "../../UI/Base/VariableUIElement"; -import {CenterFlexedElement} from "../../UI/Base/CenterFlexedElement"; +import BaseUIElement from "../../UI/BaseUIElement"; export default class GeoLocationHandler extends VariableUiElement { /** @@ -79,25 +79,23 @@ export default class GeoLocationHandler extends VariableUiElement { super( hasLocation.map( (hasLocationData) => { - let icon: string; + let icon: BaseUIElement; if (isLocked.data) { - icon = Svg.location; + icon = Svg.location_svg(); } else if (hasLocationData) { - icon = Svg.location_empty; + icon = Svg.location_empty_svg(); } else if (isActive.data) { - icon = Svg.location_empty; + icon = Svg.location_empty_svg(); } else { - icon = Svg.location_circle; + icon = Svg.location_circle_svg(); } - - return new CenterFlexedElement( - Img.AsImageElement(icon, "", "width:1.25rem;height:1.25rem") - ); + return icon }, [isActive, isLocked] ) ); + this.SetClass("mapcontrol") this._isActive = isActive; this._isLocked = isLocked; this._permission = new UIEventSource(""); diff --git a/UI/MapControlButton.ts b/UI/MapControlButton.ts index 23b885a9e..b1a595034 100644 --- a/UI/MapControlButton.ts +++ b/UI/MapControlButton.ts @@ -5,8 +5,13 @@ import Combine from "./Base/Combine"; * A button floating above the map, in a uniform style */ export default class MapControlButton extends Combine { - constructor(contents: BaseUIElement) { + constructor(contents: BaseUIElement, options?:{ + dontStyle?: boolean + }) { super([contents]); + if(!options?.dontStyle){ + contents.SetClass("mapcontrol p-1") + } this.SetClass( "relative block rounded-full w-10 h-10 p-1 pointer-events-auto z-above-map subtle-background m-0.5 md:m-1" ); diff --git a/assets/svg/location-circle.svg b/assets/svg/location-circle.svg index 480fbad11..6689a4bdf 100644 --- a/assets/svg/location-circle.svg +++ b/assets/svg/location-circle.svg @@ -1 +1,62 @@ - \ No newline at end of file + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/index.css b/index.css index 0bd790f55..832035848 100644 --- a/index.css +++ b/index.css @@ -93,6 +93,10 @@ svg, img { display: unset; } +.mapcontrol svg path{ + fill: var(--subtle-detail-color-contrast); +} + a { color: var(--foreground-color); }