Skip to content

Commit

Permalink
Allow custom icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Hurd committed Sep 17, 2023
1 parent 98d3587 commit d40d44b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/MapDisplay/RouteMarkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const RouteMarkers: React.FC<RouteMarkersProps> = ({ branch, activeThing
}

const newIcon = L.icon({
iconUrl: route?.url + "icons/" + thing.icon + ".png",
iconUrl: route?.game.icons[thing.icon] || new URL("/assets/images/route_icons/blank.png", import.meta.url).href,
iconSize: [40, 40],
iconAnchor: [20, 20],
});
Expand Down
2 changes: 2 additions & 0 deletions src/models/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ export default class Game {
id: string;
name: string;
layers: { [key: string]: Layer };
icons: { [key: string]: string };

constructor(id: string, name: string) {
this.id = id;
this.name = name;
this.layers = {};
this.icons = {};
}
}

0 comments on commit d40d44b

Please sign in to comment.