Skip to content

fix(assets): serve leaflet marker icons from the leaflet package - #289

Open
janni1288 wants to merge 1 commit into
fleetbase:mainfrom
janni1288:fix/leaflet-marker-icons
Open

fix(assets): serve leaflet marker icons from the leaflet package#289
janni1288 wants to merge 1 commit into
fleetbase:mainfrom
janni1288:fix/leaflet-marker-icons

Conversation

@janni1288

Copy link
Copy Markdown
Contributor

What

Several components (leaflet-map-manager.js, map-adapter/leaflet.js, map-adapter/google.js, order-tracking-lookup.js, customer/create-order-form.js, customer/orders.js) reference assets/images/marker-icon.png, marker-icon-2x.png and marker-shadow.png for Leaflet's default markers. These files were never added to the addon's public assets, so the browser gets 404s and shows broken image icons on the map.

Why this approach

Rather than committing copies of these images into the repo (which would drift out of sync with the installed Leaflet version over time), this serves them directly from the already-installed leaflet package via a broccoli-funnel tree - the same pattern already used in index.js for leaflet-draw and leaflet-contextmenu's dist assets.

Changes

  • index.js: new treeForLeafletImages() funnels marker-icon.png, marker-icon-2x.png, and marker-shadow.png from leaflet/dist/images into assets/images, wired into mergeWithPublicTree
  • package.json: added leaflet as a direct dependency - it was previously only resolved transitively via leaflet-draw/leaflet-contextmenu, which caused resolve.sync to fail when referenced directly

Testing

  • Verified locally that all three URLs now serve the correct images instead of 404ing:
    • /assets/images/marker-icon.png
    • /assets/images/marker-icon-2x.png
    • /assets/images/marker-shadow.png

Verification of scope

Searched the addon for all /assets/images/* references to check whether
other assets were missing besides the three named in the issue — these
three were the only ones referenced in code but missing from the assets
folder, so this should be the complete fix.

Closes #211

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (41bd574) to head (8acbf62).
⚠️ Report is 297 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff               @@
##               main      #289       +/-   ##
==============================================
+ Coverage     85.97%   100.00%   +14.02%     
  Complexity     9766      9766               
==============================================
  Files           521       521               
  Lines         37782     37762       -20     
==============================================
+ Hits          32483     37762     +5279     
+ Misses         5299         0     -5299     
Flag Coverage Δ
backend 100.00% <ø> (+14.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken Image Icons in FleetOps

1 participant