Skip to content

dft_map_interactive: add Bing Aerial as a basemap (quadkey tiles need more than a URL template) #78

Description

@NewGraphEnvironment

Problem

dft_map_interactive() offers Light / Esri Satellite / Google Satellite / OpenTopoMap as switchable basemaps. When a change patch is checked against the imagery underneath it, a third independent imagery source is often what settles the question. Imagery vintages differ between providers, so a patch that looks ambiguous on Esri can be clear on another capture date. Bing Aerial is the usual third source (it is the default "third opinion" in QGIS workflows), and floodplains#92 asks for it for the per-WSG change-review maps.

Why it is not a one-line addition

basemaps accepts either a leaflet-providers id or a URL template, and the URL branch passes the template to leaflet::addTiles(urlTemplate = ) (R/dft_map_interactive.R, basemap loop). Leaflet only substitutes {x}, {y}, {z} and {s}. Bing tiles are addressed by quadkey, a single base-4 string derived from x/y/z, so no URL template can express them.

Options

  1. Custom tile layer via htmlwidgets::onRender(). Define an L.TileLayer whose getTileUrl computes the quadkey. This needs no new dependency. It can be selected by a sentinel value in basemaps (e.g. "Bing Aerial" = "bing").
  2. A leaflet Bing plugin. The available plugins need a Bing Maps key, which the package would have to take as an option.

To establish before choosing

  • Licensing and service status. Microsoft has been retiring Bing Maps for Enterprise. Check what tile access is still permitted, and whether it needs a key, before building anything. The key-less virtualearth.net tile URLs that circulate in QGIS setups are of unclear standing. We already ship a Google tile URL with the same question over it, so decide both together rather than holding Bing to a different bar.
  • If Bing turns out not to be viable, find out whether another free, independently captured imagery source can fill the "third opinion" role. For BC, that could be a provincial orthophoto WMS/WMTS.

Acceptance

  • dft_map_interactive(..., basemaps = c(..., "Bing Aerial" = <whatever form is chosen>)) renders Bing as a radio-toggle basemap alongside the others.
  • The licence and key requirement are stated in the roxygen.
  • The test covers the quadkey computation against known tiles.

Relates: floodplains#92

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions