istarkov / google-map-thousands-markers

How to draw thousands markers with google-map-react
https://istarkov.github.io/google-map-thousands-markers/
79 stars 30 forks source link

Going fullscreen on the map messes up map marker positions #3

Open davidfurlong opened 6 years ago

davidfurlong commented 6 years ago

See your example http://istarkov.github.io/google-map-react/map/main/

Shtokins commented 4 years ago
Shtokins commented 4 years ago

How I solved it:

  1. For vertical shift (in my case, when the map in a part of scrollable page) I replaced boundingRect_ = boundingRect_ || e.currentTarget.getBoundingClientRect(); with boundingRect_ = e.currentTarget.getBoundingClientRect();

  2. For horizontal shift issue (when map-container DIV is dynamic and can be h-resized) I've added in parent component listener for that DIV width resizing and added nex trigger to this listener: window.dispatchEvent(new Event("resize"));