Skip to content

Commit 936586e

Browse files
committed
Add ability to set mapbox tile url
1 parent 38589e8 commit 936586e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ mapbox.layer.prototype.url = function(x, callback) {
4141

4242
mapbox.layer.prototype.id = function(x, callback) {
4343
if (!arguments.length) return this._id;
44-
this.url('http://a.tiles.mapbox.com/v3/' + x + '.jsonp');
44+
this.url(mapbox.MAPBOX_URL + x + '.jsonp');
4545
this.named(x);
4646
this._id = x;
4747
return this.refresh(callback);

src/load.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mapbox.load = function(url, callback) {
3333

3434
// Support bare IDs as well as fully-formed URLs
3535
if (url.indexOf('http') !== 0) {
36-
url = 'http://a.tiles.mapbox.com/v3/' + url + '.jsonp';
36+
url = mapbox.MAPBOX_URL + url + '.jsonp';
3737
}
3838

3939
wax.tilejson(url, function(tj) {
@@ -46,7 +46,7 @@ mapbox.load = function(url, callback) {
4646
lon: tj.center[0]
4747
};
4848

49-
tj.thumbnail = 'http://a.tiles.mapbox.com/v3/' + tj.id + '/thumb.png';
49+
tj.thumbnail = mapbox.MAPBOX_URL + tj.id + '/thumb.png';
5050

5151
// Instantiate tile layer
5252
tj.layer = mapbox.layer().tilejson(tj);

src/map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
if (typeof mapbox === 'undefined') mapbox = {};
22

3+
mapbox.MAPBOX_URL = 'http://a.tiles.mapbox.com/v3/';
34

45
// a `mapbox.map` is a modestmaps object with the
56
// easey handlers as defaults

0 commit comments

Comments
 (0)