Bing Maps Layer for Leaflet v1.0.0
npm install leaflet-bing-layerBing Maps Layer for Leaflet v1.0.0
Create a new Bing Maps Layer. Depends on Promises which needs a polyfill for older browsers by adding this script to your html :
``html`
| parameter | type | description |
| ----------------------------- | -------------- | ----------------------------------------------------------------------------------------------------- |
| options | string\|object | A valid Bing Maps Key or an options object. options inherits from L.TileLayer options (e.g. you can use minZoom and opacity and etc) |options.bingMapsKey
| | string | A valid Bing Maps Key [_required_] |[options.imagerySet]
| | string | _optional:_ Imagery Type [_default=Aerial_]Aerial
- - Aerial imageryAerialWithLabels
- - Aerial imagery with a road overlayAerialWithLabelsOnDemand
- - Aerial imagery with on-demand road overlay.CanvasDark
- - A dark version of the road maps.CanvasLight
- - A lighter version of the road maps which also has some of the details such as hill shading disabled.CanvasGray
- - A grayscale version of the road maps.Road
- - Roads without additional imagery. Uses the legacy static tile service.RoadOnDemand
- - Roads without additional imagery. Uses the dynamic tile service.OrdnanceSurvey
- - Ordnance Survey imagery. This imagery is visible only for the London area.Birdseye
Not supported: and BirdseyeWithLabels |[options.culture]
| | string | _optional:_ Language for labels, see options [_default=en_US_] |[options.style]
| | string | _optional:_ Use a custom map style - only works with the AerialWithLabelsOnDemand and RoadOnDemand imagerySet options. |
Other options are passed through to a Leaflet TileLayer
| Method | Returns | Description |
| ---------- | -------------- | ------------- |
| getMetaData( | Promise | Get the Bing Imagery metadata for a specific LatLng and zoom level. latLng or zoom are optional if the layer is attached to a map, they default to current map center and zoom. Returns a Promise that resolves to the metadata JSON from Bing |
`js``
var map = L.map('map').setView([51.505, -0.09], 13)
L.tileLayer.bing(MyBingMapsKey).addTo(map)
MIT