Skip to content

Commit

Permalink
Use a fixed image for one-way arrows, not from the basemap. #20
Browse files Browse the repository at this point in the history
Doesn't really solve the problem yet, because switching basemaps erases
the extra images loaded in maplibre
  • Loading branch information
dabreegster committed Mar 1, 2024
1 parent 8422a1d commit dd9c709
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Binary file added web/assets/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions web/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import onewayArrowUrl from "../assets/arrow.png?url";
import logo from "../assets/logo.svg?url";
import "@picocss/pico/css/pico.jade.min.css";
import initLtn from "backend";
Expand Down Expand Up @@ -110,6 +111,10 @@
id: "school_street",
url: `${import.meta.env.BASE_URL}/filters/school_street_icon.gif`,
},
{
id: "oneway-arrow",
url: onewayArrowUrl,
},
]}
>
<Geocoder />
Expand Down
4 changes: 1 addition & 3 deletions web/src/OneWayLayer.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
import { layerId } from "./common";
import { SymbolLayer } from "svelte-maplibre";
// TODO Using the icon from maptiler basemap, so it won't work on some basemaps
</script>

<SymbolLayer
Expand All @@ -13,7 +11,7 @@
["!=", ["get", "direction"], "both"],
]}
layout={{
"icon-image": "oneway",
"icon-image": "oneway-arrow",
"icon-size": 1.0,
"symbol-placement": "line",
"symbol-spacing": 50,
Expand Down

0 comments on commit dd9c709

Please sign in to comment.