Working fine with a given mvt URL.

This commit is contained in:
vershwal
2018-06-18 00:37:10 +05:30
parent 66f27813ff
commit ab60d57aa5
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -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);
+3
View File
@@ -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;
}, {});
}