mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-31 00:10:33 +01:00
Merge pull request #128 from orangemug/feature/rtl-plugin-issue-126
Added @mapbox/mapbox-gl-rtl-text plugin
This commit is contained in:
commit
9b1dd44b9d
4 changed files with 16 additions and 3 deletions
|
@ -49,6 +49,6 @@ module.exports = {
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
title: 'Maputnik',
|
title: 'Maputnik',
|
||||||
template: './src/template.html'
|
template: './src/template.html'
|
||||||
}),
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://github.com/maputnik/editor#readme",
|
"homepage": "https://github.com/maputnik/editor#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@mapbox/mapbox-gl-rtl-text": "^0.1.0",
|
||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
"codemirror": "^5.18.2",
|
"codemirror": "^5.18.2",
|
||||||
"color": "^1.0.3",
|
"color": "^1.0.3",
|
||||||
|
@ -103,11 +104,12 @@
|
||||||
"babel-preset-es2015": "6.18.0",
|
"babel-preset-es2015": "6.18.0",
|
||||||
"babel-preset-react": "6.16.0",
|
"babel-preset-react": "6.16.0",
|
||||||
"babel-runtime": "^6.11.6",
|
"babel-runtime": "^6.11.6",
|
||||||
|
"base64-loader": "^1.0.0",
|
||||||
"css-loader": "0.26.1",
|
"css-loader": "0.26.1",
|
||||||
"eslint": "^3.5.0",
|
"eslint": "^3.5.0",
|
||||||
"eslint-plugin-react": "^6.2.0",
|
"eslint-plugin-react": "^6.2.0",
|
||||||
"extract-text-webpack-plugin": "^1.0.1",
|
"extract-text-webpack-plugin": "^1.0.1",
|
||||||
"file-loader": "0.9.0",
|
"file-loader": "^0.11.1",
|
||||||
"html-webpack-plugin": "^2.22.0",
|
"html-webpack-plugin": "^2.22.0",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"karma": "^1.3.0",
|
"karma": "^1.3.0",
|
||||||
|
@ -124,7 +126,6 @@
|
||||||
"stylelint": "^7.7.1",
|
"stylelint": "^7.7.1",
|
||||||
"stylelint-config-standard": "^15.0.1",
|
"stylelint-config-standard": "^15.0.1",
|
||||||
"transform-loader": "^0.2.3",
|
"transform-loader": "^0.2.3",
|
||||||
"url-loader": "0.5.7",
|
|
||||||
"wdio-mocha-framework": "^0.5.9",
|
"wdio-mocha-framework": "^0.5.9",
|
||||||
"wdio-phantomjs-service": "^0.2.2",
|
"wdio-phantomjs-service": "^0.2.2",
|
||||||
"wdio-spec-reporter": "^0.1.0",
|
"wdio-spec-reporter": "^0.1.0",
|
||||||
|
|
|
@ -12,6 +12,7 @@ import Color from 'color'
|
||||||
import { colorHighlightedLayer } from '../../libs/highlight'
|
import { colorHighlightedLayer } from '../../libs/highlight'
|
||||||
import 'mapbox-gl/dist/mapbox-gl.css'
|
import 'mapbox-gl/dist/mapbox-gl.css'
|
||||||
import '../../mapboxgl.css'
|
import '../../mapboxgl.css'
|
||||||
|
import '../../libs/mapbox-rtl'
|
||||||
|
|
||||||
function renderLayerPopup(features) {
|
function renderLayerPopup(features) {
|
||||||
var mountNode = document.createElement('div');
|
var mountNode = document.createElement('div');
|
||||||
|
|
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);
|
Loading…
Reference in a new issue