Skip to content

Commit

Permalink
Don't append .json to sprite URLs (closes #1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhousel committed Jan 13, 2016
1 parent 25b02a0 commit e47477f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/style/image_sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ImageSprite(base) {

var format = this.retina ? '@2x' : '';

ajax.getJSON(normalizeURL(base, format, '.json'), function(err, data) {
ajax.getJSON(normalizeURL(base, format, ''), function(err, data) {
if (err) {
this.fire('error', {error: err});
return;
Expand Down
4 changes: 2 additions & 2 deletions test/js/util/mapbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ test("mapbox", function(t) {
t.test('.normalizeSpriteURL', function(t) {
t.test('normalizes mapbox:// URLs', function(t) {
t.equal(
mapbox.normalizeSpriteURL('mapbox://sprites/mapbox/streets-v8', '', '.json'),
'https://api.mapbox.com/styles/v1/mapbox/streets-v8/sprite.json?access_token=key'
mapbox.normalizeSpriteURL('mapbox://sprites/mapbox/streets-v8', '', ''),
'https://api.mapbox.com/styles/v1/mapbox/streets-v8/sprite?access_token=key'
);

t.equal(
Expand Down

0 comments on commit e47477f

Please sign in to comment.