Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ef3e86

Browse files
committed
[fixup] more robust .getStyle method
1 parent 91a5f32 commit 1ef3e86

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plots/mapbox/mapbox.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ proto.toImage = function(format) {
241241
proto.getStyle = function() {
242242
var name = this.map.getStyle().name;
243243

244-
return name.split(' ')[1].toLowerCase();
244+
return name
245+
.replace('Mapbox ', '')
246+
.replace(' ', '-')
247+
.toLowerCase();
245248
};
246249

247250
// convenience wrapper to create blank GeoJSON sources

0 commit comments

Comments
 (0)