Skip to content

Commit

Permalink
Merge pull request #42 from totum-tools/mhurd/feat/custom_icons
Browse files Browse the repository at this point in the history
Allow custom icons
  • Loading branch information
Matt-Hurd authored Sep 17, 2023
2 parents 5ab958c + d40d44b commit 0a81455
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 0a81455

Please sign in to comment.