Skip to content

Instantly share code, notes, and snippets.

@AlexCortinas
Created April 9, 2019 16:20
Show Gist options
  • Save AlexCortinas/98c72c8ea02629e8537c7006ee752572 to your computer and use it in GitHub Desktop.
Save AlexCortinas/98c72c8ea02629e8537c7006ee752572 to your computer and use it in GitHub Desktop.
Leaflet with parcel (or similar I guess)
import { Icon } from "leaflet"
delete Icon.Default.prototype._getIconUrl
Icon.Default.mergeOptions({
  iconRetinaUrl: require("leaflet/dist/images/marker-icon-2x.png"),
  iconUrl: require("leaflet/dist/images/marker-icon.png"),
  shadowUrl: require("leaflet/dist/images/marker-shadow.png")
})

The problem is described here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment