Set MIME type for RTL blob

This commit is contained in:
pathmapper 2018-11-25 08:13:21 +01:00 committed by GitHub
parent 7d5d9e2d82
commit 92b970377d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,9 +3,9 @@ import MapboxGl from 'mapbox-gl'
// Load mapbox-gl-rtl-text using object urls without needing http://localhost for AJAX. // Load mapbox-gl-rtl-text using object urls without needing http://localhost for AJAX.
const data = require("raw-loader?mimetype=text/javascript!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js"); const data = require("raw-loader?mimetype=text/javascript!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js");
const blob = new window.Blob([data]); const blob = new window.Blob([data], {
const objectUrl = window.URL.createObjectURL(blob, {
type: "text/javascript" type: "text/javascript"
}); });
const objectUrl = window.URL.createObjectURL(blob);
MapboxGl.setRTLTextPlugin(objectUrl); MapboxGl.setRTLTextPlugin(objectUrl);