Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

92
Vistas
Remove movement/draggable scroll on google maps react

I have a map.jsx file in my react app which contains the following code:

import React from 'react';
import GoogleMapReact from 'google-map-react';
import './map.css';

const Map = ({ location, zoomLevel }) => (
    <div className='map'>
        <div className='google-map'>
            <GoogleMapReact
                bootstrapURLKeys={{ key: 'keyID' }}
                defaultCenter={location}
                defaultZoom={zoomLevel}></GoogleMapReact>
        </div>
    </div>
);

export default Map;

This component is then called from my main page file 'chatApp.jsx' in order to display the map on screen:

import React, { useEffect, useRef, useState } from 'react';
import { useParams } from 'react-router-dom';
import MapSection from '../components/map/Map';

const location = {
    address: 'House',
    lat: 53.123,
    lng: -2.123,
};

export const ChatPage = () => {
    return (
        <main className='chat-wrapper'>
            <MapSection location={location} zoomLevel={18} /> {/* include it here */}
        </main>
    );
};

My question is: How can i stop the map from being able to be dragged/scrolled and moved around? I want it constantly set on one place, with the image over the top of it. Is there a way to introduce bounds into this code?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I realised i just needed to add this into the google map parameters:

options={{ gestureHandling: 'none'}}
about 4 years 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 vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda