• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

66
Vistas
My custom buttom disapear on fullscreen in @react-google-maps/api

I create a custom button that allows me to do some stuff over the map. I press the fullscreen button and it disappears.

I tried to play with the console and take it forward with z-index and other stuff.

https://codesandbox.io/s/romantic-chihiro-ns1vv?file=/src/LoadMap.jsx

This is my code in codesandbox for the bug.

Please press on the "open in a new window" to get the fullscreen button.

Thanks!

9 months ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

With MapControl component.

    <MapControl position={google.maps.ControlPosition.BOTTOM_CENTER}>
  <div>That was easy</div>
</MapControl>

https://gist.github.com/jgimbel/6a36d60e28aaf453d0093ddc47f36533

9 months ago · Juan Pablo Isaza Denunciar

0

fullscreen mode creates inside it element. You should add your button after it creates, in React you can do it with ReactDOM.createPortal. Here you should add your btn: document.getElementById('your-map-id').getElementsByTagName('div')[0]

9 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.