inocan-group / vue3-google-map

A set of composable components for easy use of Google Maps in your Vue 3 projects.
https://vue3-google-map.com
MIT License
285 stars 56 forks source link

Custom control makes the map jump #183

Closed cadilhac closed 1 month ago

cadilhac commented 11 months ago

Adding a custom control (in my case this is a button but it can be a simple unstyled text for the test) in the map creates 2 issues:

Any idea why it does that?

cadilhac commented 11 months ago

The only workaround I found is to set my custom control initially hidden (via css) and add this code when receiving the first idle event:

setTimeout(() => {
    myControlRef.value.style.display = 'block'
}, 500)

Unfortunately this works if I have only one custom control at this position. Two hidden buttons will overlap. Bad for me, I have 2 custom controls.

HusamElbashir commented 10 months ago

Hey @cadilhac

We got some fixes on develop that haven't been released yet that might potentially address this. If you use pnpm can you point your vue3-google-map dependency at git+https://github.com/inocan-group/vue3-google-map#develop see if it fixes the issue? Otherwise you can share a reproduction on https://vite.new/vue and I'll take a look

JoseGoncalves commented 10 months ago

Hi @cadilhac, I have a fork of this project that you can use to follow @HusamIbrahim sugestion. Version 0.19.0 of @josempgon/vue3-google-map was built with the latest (unpublished) code from develop.

cadilhac commented 10 months ago

I have some difficulties reproducing the original issue (the jump) so it's difficult to test right now. As soon as I can, I will report. However, I can tell that with the mentioned fork 0.19.0, the custom control still briefly appears in the corner before being displayed at the final position.

HusamElbashir commented 1 month ago

Closing due to inactivity