Skip to content

Commit

Permalink
fix event listener type
Browse files Browse the repository at this point in the history
  • Loading branch information
navaronbracke committed Jan 11, 2024
1 parent 1fc8e60 commit 15acde3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@ class MarkersController extends GeometryController {
infoWindowOptions.content is HTMLElement) {
final HTMLElement content = infoWindowOptions.content! as HTMLElement;

// TODO(ditman): Use the premade handler
// See https://github.com/dart-lang/web/issues/76
content.addEventListener(
'click',
allowInterop((_) {
_onInfoWindowTap(marker.markerId);
}).toJS,
);
content.onclick = (JSAny? _) {
_onInfoWindowTap(marker.markerId);
}.toJS;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ class TileOverlayController {
Blob(tile.data!.map((int byte) => byte.toJS).toList().toJS) as JSObject,
);
img.src = src;
img.addEventListener(
'load',
allowInterop((_) {
img.hidden = false.toJS;
URL.revokeObjectURL(src);
}).toJS,
);
img.onload = (JSAny? _) {
img.hidden = false.toJS;
URL.revokeObjectURL(src);
}.toJS;
});

return img;
Expand Down

0 comments on commit 15acde3

Please sign in to comment.