Skip to content

Commit

Permalink
Change name to L.TileLayer.Bing per Leaflet plugin guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Dec 2, 2015
1 parent c2b3f6c commit 0b3b0c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Bing Maps Layer for Leaflet v1.0.0


### L.BingLayer(options|BingMapsKey)
### L.TileLayer.Bing(options|BingMapsKey)

Create a new Bing Maps Layer. Depends on [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which needs a polyfill for [older browsers](http://caniuse.com/#feat=promises) by adding this script to your html `<head>`:

Expand All @@ -25,7 +25,7 @@ Create a new Bing Maps Layer. Depends on [Promises](https://developer.mozilla.or

```js
var map = L.map('map').setView([51.505, -0.09], 13)
L.bingLayer(MyBingMapsKey).addTo(map)
L.TileLayer.bing(MyBingMapsKey).addTo(map)
```

[Live Example](http://gmaclennan.github.io/leaflet-bing-layer/) see [index.html](index.html)
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

var map = L.map('map').setView([51.505, -0.09], 13)

L.bingLayer(BingMapsKey).addTo(map)
L.TileLayer.bing(BingMapsKey).addTo(map)
</script>
</body>
</html>
10 changes: 5 additions & 5 deletions leaflet-bing-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
* Create a basic map
* @example
* var map = L.map('map').setView([51.505, -0.09], 13)
* L.bingLayer(MyBingMapsKey).addTo(map)
* L.TileLayer.Bing(MyBingMapsKey).addTo(map)
*/
L.BingLayer = L.TileLayer.extend({
L.TileLayer.Bing = L.TileLayer.extend({
options: {
BingMapsKey: null, // Required
imagerySet: 'Aerial',
Expand All @@ -92,7 +92,7 @@
options = L.setOptions(this, options)
options.minZoom = Math.max(1, options.minZoom)

var metaDataUrl = L.Util.template(L.BingLayer.METADATA_URL, {
var metaDataUrl = L.Util.template(L.TileLayer.Bing.METADATA_URL, {
BingMapsKey: this.options.BingMapsKey,
imagerySet: this.options.imagerySet
})
Expand Down Expand Up @@ -225,8 +225,8 @@
}
})

L.bingLayer = function (options) {
return new L.BingLayer(options)
L.TileLayer.bing = function (options) {
return new L.TileLayer.Bing(options)
}

return L
Expand Down

0 comments on commit 0b3b0c5

Please sign in to comment.