Skip to content

Commit

Permalink
Fix: Tooltips can rely on parent layer getBounds() too, so they work …
Browse files Browse the repository at this point in the history
…on ImageOverlays (#7306)

Fixes #6780
  • Loading branch information
IvanSanchez authored Oct 6, 2020
1 parent bfe7c68 commit bc918d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/layer/DivOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ export var DivOverlay = Layer.extend({
latlng = layer.getCenter();
} else if (layer.getLatLng) {
latlng = layer.getLatLng();
} else if (layer.getBounds) {
latlng = layer.getBounds().getCenter();
} else {
throw new Error('Unable to get source layer LatLng.');
}
Expand Down

0 comments on commit bc918d4

Please sign in to comment.