Merge pull request #128 from orangemug/feature/rtl-plugin-issue-126

Added @mapbox/mapbox-gl-rtl-text plugin
This commit is contained in:
Lukas Martinelli 2017-04-11 16:42:17 -04:00 committed by GitHub
commit 9b1dd44b9d
4 changed files with 16 additions and 3 deletions

View file

@ -49,6 +49,6 @@ module.exports = {
new HtmlWebpackPlugin({
title: 'Maputnik',
template: './src/template.html'
}),
})
]
};

View file

@ -20,6 +20,7 @@
"license": "MIT",
"homepage": "https://github.com/maputnik/editor#readme",
"dependencies": {
"@mapbox/mapbox-gl-rtl-text": "^0.1.0",
"classnames": "^2.2.5",
"codemirror": "^5.18.2",
"color": "^1.0.3",
@ -103,11 +104,12 @@
"babel-preset-es2015": "6.18.0",
"babel-preset-react": "6.16.0",
"babel-runtime": "^6.11.6",
"base64-loader": "^1.0.0",
"css-loader": "0.26.1",
"eslint": "^3.5.0",
"eslint-plugin-react": "^6.2.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "0.9.0",
"file-loader": "^0.11.1",
"html-webpack-plugin": "^2.22.0",
"json-loader": "^0.5.4",
"karma": "^1.3.0",
@ -124,7 +126,6 @@
"stylelint": "^7.7.1",
"stylelint-config-standard": "^15.0.1",
"transform-loader": "^0.2.3",
"url-loader": "0.5.7",
"wdio-mocha-framework": "^0.5.9",
"wdio-phantomjs-service": "^0.2.2",
"wdio-spec-reporter": "^0.1.0",

View file

@ -12,6 +12,7 @@ import Color from 'color'
import { colorHighlightedLayer } from '../../libs/highlight'
import 'mapbox-gl/dist/mapbox-gl.css'
import '../../mapboxgl.css'
import '../../libs/mapbox-rtl'
function renderLayerPopup(features) {
var mountNode = document.createElement('div');

11
src/libs/mapbox-rtl.js Normal file
View 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);