mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 07:30:00 +00:00
Switch to using object urls so we don't need ajax for mapbox-gl-rtl-text plugin (issue #126)
This commit is contained in:
11
src/libs/mapbox-rtl.js
Normal file
11
src/libs/mapbox-rtl.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import MapboxGl from 'mapbox-gl/dist/mapbox-gl.js'
|
||||
|
||||
// Load mapbox-gl-rtl-text using object urls without needing http://localhost for AJAX.
|
||||
const data = require("base64?mimetype=text/javascript!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.js");
|
||||
|
||||
const blob = new window.Blob([window.atob(data)]);
|
||||
const objectUrl = window.URL.createObjectURL(blob, {
|
||||
type: "text/javascript"
|
||||
});
|
||||
|
||||
MapboxGl.setRTLTextPlugin(objectUrl);
|
||||
Reference in New Issue
Block a user