Skip to content

Commit

Permalink
Working fine with a given mvt URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
vershwal committed Jun 17, 2018
1 parent 66f2781 commit ab60d57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion modules/svg/mvt.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ export function svgMvt(projection, context, dispatch) {
};

drawMvt.url = function(url) {
url = 'https://api.mapbox.com/v4/mapbox.mapbox-streets-v6/9/150/194.vector.pbf?access_token=pk.eyJ1IjoidmVyc2h3YWwiLCJhIjoiY2pocmk1c2J5M28wbDM1cGU1ZDdpeDB1eSJ9.KN1fjHMCdSUsYcuvwiXWIA';
buffer(url).then(function(data) {
_src = url;
var match = url.match(/(pbf|mvt|(?:geo)?json)/i);
Expand Down
3 changes: 3 additions & 0 deletions modules/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export function utilStringQs(str) {
if (parts.length === 2) {
obj[parts[0]] = (null === parts[1]) ? '' : decodeURIComponent(parts[1]);
}
if (parts[0] === 'mvt') {
obj[parts[0]] = (parts[2] != undefined) ? (decodeURIComponent(parts[1]) + '=' + decodeURIComponent(parts[2])) : (decodeURIComponent(parts[1]));
}
return obj;
}, {});
}
Expand Down

0 comments on commit ab60d57

Please sign in to comment.