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

175
Views
Can't get controls to display on react leaflet mapContainer

Adding a map component to my app using react leaflet. The map displays fine, along with geoJSONs. Popups will go where I want them but are invisible.

The biggest issue is that the zoom controls (+- buttons) that I see in every online example have not been displaying. Map Component

Here is the code for it:

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>
)

} }

export default MapView

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

0

I have found one video which shows how you can set zoom and can fix it. https://egghead.io/lessons/react-change-the-react-leaflet-map-zoomcontrol-location-and-icons and I will also check in codesandbox as well if I can find a proper solution for you :)

This is on stackoverflow.

React-Leaflet custom markers with condition

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!