Creating a Bing and Google Tile Layer for Leaflet

Google Maps

Google Maps forbids such uses. The only allowed access to their content is through their Maps API (see section 10.1 of the ToS).

Bing Maps Web Services

Bing Maps is the only commercial provider I know that allows such uses, through their Web Services feature. You will need an API key, though.

Bing will be a bit annoying to get, since they use quadkeys (an unique index for each tile) instead of {x,y} coordinates (good comparison there). You'll therefore need to create a new L.ILayer implementation that conforms to this URL scheme.

Since you're of course not the first one to have this request  ;)  , some others have already coded such implementations. One is a pending pull request to the Leaflet repo, the other is directly available as a Gist. Try whichever you prefer, and add your weight to the pull request to make it merged faster  :)


I know google maps forbids it, yet if you use this plugin, you can do it.

Check the google.html file under the examples folder.

Change line 15 to:

var ggl = new L.Google("ROADMAP);

It should then work for you :)

However, I dunno if this abides by google's TOS!


You can try to use Bing maps tiles directly. I think this is not compliant with Bing TOS, but register the key at Microsoft, give them copyright link from maps implementation, and there should be no problem. Check out for example Maps of All to see live Bing tiles inside Google maps API. If you then check http://www.mapsofall.com/public/js.js, there is concrete URL of Bing tiles.