Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
No se pueden mostrar los controles en el mapContainer del folleto de reacción

Agregar un componente de mapa a mi aplicación usando el folleto de reacción. El mapa se muestra bien, junto con geoJSON. Las ventanas emergentes irán donde yo las quiera, pero son invisibles.

El mayor problema es que los controles de zoom (+-botones) que veo en todos los ejemplos en línea no se han mostrado. Componente de mapa

Aquí está el código para ello:

 import React, { PureComponent, Component} from 'react' import './Map.css' import 'leaflet/dist/leaflet.css' import { MapContainer, TileLayer, Marker, GeoJSON, ZoomControl, Popup} from 'react-leaflet' class MapView extends PureComponent { constructor(props) { super(props); } render () { var position = [40.8, -74.15] return ( <MapContainer className='Map-Container' center={position} zoom={14} minZoom={10} maxZoom={16} > <ZoomControl position="topleft" /> <Marker position={position}> <Popup> A pretty CSS3 popup. <br /> Easily customizable. </Popup> </Marker> <TileLayer className='TileLayer' url='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' attribution='Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' /> </MapContainer> )

} }

exportar MapView predeterminado

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Encontré un video que muestra cómo puede configurar el zoom y cómo solucionarlo. https://egghead.io/lessons/react-change-the-react-leaflet-map-zoomcontrol-location-and-icons y también revisaré codesandbox si puedo encontrar una solución adecuada para ti :)

Esto está en stackoverflow.

Marcadores personalizados React-Leaflet con condición

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!