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

197
Views
react-leaflet marker is broken

I tried using react-leaflet to show map on my react app, and i did things that are based on the docs, but for some reason, my marker is broken, here's my code

const foodIcon = new L.icon({
        iconUrl: require('../images/makanan.png'),
        iconSize: [35,45]
    })

    const position = [51.505, -0.09]


               <div id="map">
                      <div className="map-container">
                            <MapContainer style={{ width: '100%', height: '600px' }} center={position} zoom={13} scrollWheelZoom={false}>
                                <TileLayer
                                    attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
                                    url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
                                />
                                <Marker position={position} icon={ foodIcon }>
                                <Popup>
                                    Hello
                                </Popup>
                                </Marker>
                            </MapContainer>
                       </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Double check the image path and whether you have the image in right place. Works for me.

Demo

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!