0

I am trying to load an icon into a marker as shown below

  var myIcon = L.icon({
    iconUrl: '/Users/k------/Documents/GitHub/Geospatial-Opportunities-for-Supermarkets/static/26501+.JPG',
    iconSize: [38, 95],
    iconAnchor: [22, 94],
    popupAnchor: [-3, -76]
  })

  L.marker([43.68, -79.38], {icon:myIcon}).addTo(myMap);

I'm getting a 404 NOT Found Error and I don't know why

  • 1
    Looks like you want to use the [`file:` URL protocol scheme](https://en.wikipedia.org/wiki/File_URI_scheme) instead of relative paths. – IvanSanchez Feb 22 '20 at 13:28
  • @IvanSanchez Thanks, but not sure what that really means? – KhaledCodes Feb 23 '20 at 05:40
  • Start by reading https://stackoverflow.com/questions/21306512/difference-between-relative-path-and-absolute-path-in-javascript , https://stackoverflow.com/questions/7857416/file-uri-scheme-and-relative-files and [RFC 8089](https://tools.ietf.org/html/rfc8089) – IvanSanchez Feb 23 '20 at 10:58

0 Answers0