Skip to content

Commit

Permalink
Implement requirements of assignment D3.a.
Browse files Browse the repository at this point in the history
  • Loading branch information
blujai831 committed Nov 7, 2024
1 parent f2de070 commit 51aa8c7
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 134 deletions.
22 changes: 0 additions & 22 deletions example.html

This file was deleted.

99 changes: 0 additions & 99 deletions src/example.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/leafletWorkaround.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @deno-types="npm:@types/leaflet@^1.9.14"
import leaflet from "leaflet";

// Work around bug in Leaflet (https://github.com/Leaflet/Leaflet/issues/4968)
Expand All @@ -8,3 +9,13 @@ import shadowUrl from "leaflet/dist/images/marker-shadow.png";
delete (leaflet.Icon.Default.prototype as unknown as { _getIconUrl: unknown })
._getIconUrl;
leaflet.Icon.Default.mergeOptions({ iconUrl, iconRetinaUrl, shadowUrl });

// Workaround for lack of any way to instantiate an extended layer type
export function leafletExtend<LayerType>(
layerType: leaflet.Class & {
extend: (extensions: object) => new (...args: unknown[]) => LayerType;
},
extensions: object,
) {
return layerType.extend(extensions);
}
Loading

0 comments on commit 51aa8c7

Please sign in to comment.