rewrite in mapbox.js