Skip to content

Commit

Permalink
npx gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
CloudLun committed Mar 6, 2024
1 parent 17766a5 commit d180896
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions utils/markerCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const markerCreator = (e: MapMouseEvent, m: mapboxgl.Map) => {
let directionImg: HTMLImageElement | undefined;
let markerImg: HTMLImageElement | undefined;

if (typeof window !== 'undefined') { // Check if window object is available (i.e., if code is executing in a browser environment)
if (typeof window !== 'undefined') {
directionImg = new Image(50, 50);
markerImg = new Image(25, 25);

Expand All @@ -20,7 +20,6 @@ export const markerCreator = (e: MapMouseEvent, m: mapboxgl.Map) => {
sdf: true,
});

// Set the src attribute after attaching onload event handler
directionImg.src = directionSVG.src;
markerImg.src = markerSVG.src;

Expand Down

0 comments on commit d180896

Please sign in to comment.