Skip to content

Commit

Permalink
Switched to relative urls
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanortbals committed Sep 11, 2023
1 parent 1be1742 commit bd51cbe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
/>
<link href="reset.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
<link href="./reset.css" rel="stylesheet" />
<link href="./style.css" rel="stylesheet" />
</head>
<body>
<a id="logo" href="/about/">
Expand All @@ -31,11 +31,14 @@ <h1>Float Maps</h1>
</span>
<div id="layer-dropdown-content">
<button id="simple-layer-selector" class="layer-selector selected">
<img class="layer-preview" src="images/simple-layer-preview.png" />
<img class="layer-preview" src="./images/simple-layer-preview.png" />
Simple
</button>
<button id="satellite-layer-selector" class="layer-selector">
<img class="layer-preview" src="images/satellite-layer-preview.png" />
<img
class="layer-preview"
src="./images/satellite-layer-preview.png"
/>
Satellite
</button>
</div>
Expand Down
8 changes: 4 additions & 4 deletions map/map-images.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { Map } from "mapbox-gl";

export function addImagesToMap(map: Map) {
map.loadImage("images/public-access-pin.png", (error, result) => {
map.loadImage("./images/public-access-pin.png", (error, result) => {
if (error) throw error;

map.addImage("public-access-pin", result!);
});

map.loadImage("images/private-access-pin.png", (error, result) => {
map.loadImage("./images/private-access-pin.png", (error, result) => {
if (error) throw error;

map.addImage("private-access-pin", result!);
});

map.loadImage("images/landmark-pin.png", (error, result) => {
map.loadImage("./images/landmark-pin.png", (error, result) => {
if (error) throw error;

map.addImage("landmark-pin", result!);
});

map.loadImage("images/cluster.png", (error, result) => {
map.loadImage("./images/cluster.png", (error, result) => {
if (error) throw error;

map.addImage("cluster", result!);
Expand Down
4 changes: 2 additions & 2 deletions map/map-sources.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Map } from "mapbox-gl";

export function addSourcesToMap(map: Map) {
map.addSource("rivers", { type: "geojson", data: "sources/rivers.json" });
map.addSource("rivers", { type: "geojson", data: "./sources/rivers.json" });

map.addSource("river-features", {
type: "geojson",
data: "sources/river-features.json",
data: "./sources/river-features.json",
cluster: true,
clusterMaxZoom: 9,
clusterRadius: 50,
Expand Down

0 comments on commit bd51cbe

Please sign in to comment.