Skip to content

fix!: point HERE variants at v3 resources and styles - #715

Merged
brunob merged 1 commit into
leaflet-extras:masterfrom
KhadeerBasha1232:fix-here-v3-variants
Dec 3, 2026
Merged

brunob merged 1 commit into
leaflet-extras:masterfrom
KhadeerBasha1232:fix-here-v3-variants

Conversation

@KhadeerBasha1232

Copy link
Copy Markdown
Contributor

Follow-up to #714. This fixes the 24 HERE failures the test suite reports on master.

#670 moved HERE to the Raster Tile API v3 URL, but several variants still set v2 options that the v3 URL ignores (base, type, mapID, subdomains):

  • basicMap (no labels) and mapLabels (labels only) loaded the full explore.day map.
  • hybridDay*, satelliteDay and terrainDay* set base: 'aerial', which does nothing in v3, and the hybrid and terrain ones request v2 style names (hybrid.day, terrain.day, ...) that don't exist in v3.
  • carnavDayGrey, pedestrianDay and pedestrianNight also request v2 style names.
  • trafficFlow loaded explore.day base tiles, not traffic.

Changes

  • The URL now uses a {resource} option (base by default). basicMap uses background and mapLabels uses label, following Select the map tile type.

  • The v2 variants keep their names but now use the v3 style from HERE's v2 → v3 migration table:

    Variant Before (style=) After (style=)
    carnavDayGrey carnav.day.grey lite.day
    hybridDay, hybridDayMobile, hybridDayTransit hybrid.day, hybrid.day.mobile, hybrid.day.transit explore.satellite.day
    hybridDayGrey hybrid.grey.day lite.satellite.day
    pedestrianDay / pedestrianNight pedestrian.day / pedestrian.night explore.day / explore.night
    satelliteDay satellite.day satellite.day (unchanged)
    terrainDay, terrainDayMobile terrain.day, terrain.day.mobile topo.day

    For the mobile and transit schemes, the table adds ppi=400 or features=public_transit:all_systems. I didn't add those here, so these variants now match their base style.

  • Removed the unused v2 options, and the v2 app_id/app_code demo keys in preview/shared.js. HERE is already excluded from the preview, so the keys were only being added to the test layers.

  • Removed trafficFlow (breaking). Traffic tiles come from a separate API, https://traffic.maps.hereapi.com/v3/flow/mc/{z}/{x}/{y}/{format} (docs), which takes style and size but not lang. Every variant shares the provider's language option, so the variant would have to send a parameter that API doesn't document. Since it already served base map tiles, I removed it rather than ship a guess. If you'd like traffic tiles back, I can add them as a separate provider, for example HERETraffic.

Testing

  • npm run lint passes.
  • I added two HERE tests in tests/test.js: one checks the resource path for each variant type, the other checks the v2 → v3 style mapping. With test: fix the browser test suite and check provider tiles in CI #714's runner (npm run testsuite):
    • on master: 580 passing, 26 failing (the 24 existing HERE failures plus the 2 new tests);
    • with this PR: 603 passing, 0 failing.
  • I don't have a HERE API key, so I didn't load real tiles. The URLs match the examples in HERE's docs.

Performance

No impact: this only changes static provider definitions (net -21 lines in leaflet-providers.js) and runs no new code.

The HERE provider moved to the Raster Tile API v3 URL, but its variants
still set v2 options (base, type, mapID, subdomains) that the v3 URL
ignores. basicMap, mapLabels and the aerial variants therefore all
loaded explore.day tiles, and the hybrid, pedestrian, carnav and
terrain variants requested v2 style names that v3 does not have.

- Add a {resource} option to the URL: basicMap uses background tiles
  and mapLabels uses label tiles.
- Map v2 schemes to the v3 styles from HERE's migration guide.
- Remove the unused v2 options, and the v2 app_id/app_code demo keys
  in preview/shared.js.
- Remove trafficFlow: traffic tiles come from a separate API
  (traffic.maps.hereapi.com/v3/flow), which does not take lang.

BREAKING CHANGE: HERE.trafficFlow is removed. It loaded explore.day
base map tiles, not traffic.
@brunob
brunob force-pushed the fix-here-v3-variants branch from 5be65c1 to 6e5a8d2 Compare December 3, 2026 19:36
@brunob
brunob merged commit 29a6a0e into leaflet-extras:master Dec 3, 2026
1 of 2 checks passed
brunob added a commit that referenced this pull request Dec 3, 2026
@brunob

brunob commented Dec 3, 2026

Copy link
Copy Markdown
Member

Thx again !

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.

2 participants