Search code examples
reactjstypescriptreact-leaflet

+ and - control options in react leaflet


Is there a way in which I can remove the "+" and "-" symbols from my react-leaftlet map container?

+ and - symbols

This is my mapContainer element:

<MapContainer
    center={[0.0, 0.0]}
    zoom={2}
    attributionControl={false}
    doubleClickZoom={false}
    boxZoom={false}
    zoomSnap={0.2}>
    <TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"/>
</MapContainer>

Solution

  • You should be able to use the zoomControl map creation option, which is ported as a prop in React Leaflet:

    <MapContainer
        zoomControl={false}
    </MapContainer>
    

    When creating a MapContainer element, its props are used as options to create the Map instance.