0

Just installed Leaflet (using Yarn) into my Rails app that uses Propshaft.

All other packages are working fine but the markers and layer images for Leaflet to display. I've hit this issue with other packages but those only reference images from CSS and I've fixed those by adding a line like the one below to my assets.rb initializer.

This doesn't appear to be working here though and i'm wondering if it has anything to with the images being referenced from the JS files?

Any ideas how I can resolve this without having to relocate the images? I'd rather leave them inside the package just like other packages I use.

Rails.application.config.assets.paths << Rails.root.join("node_modules", "photoswipe", "src", "css", "default-skin")
Rails.application.config.assets.paths << Rails.root.join("node_modules", "flag-icons", "flags")
Rails.application.config.assets.paths << Rails.root.join("node_modules", "leaflet", "dist")

The path being used for the marker images with the above code is:

http://localhost:3000/assets/images/marker-icon-2x.png

Thanks

rctneil
  • 7,016
  • 10
  • 40
  • 83

0 Answers0