Skip to content

Commit

Permalink
Merge pull request #22 from mapbox/1ec5-ja-ko-21
Browse files Browse the repository at this point in the history
Add Japanese, Korean to supported languages
  • Loading branch information
1ec5 authored Jul 3, 2018
2 parents f5310b2 + 34c52a0 commit 2babf3b
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@ Create a minified standalone build.
Showcasing the languages supported by Mapbox Streets.

- [Your Browser language](https://mapbox.github.io/mapbox-gl-language/examples/browser.html)
- [English](https://mapbox.github.io/mapbox-gl-language/examples/en.html)
- [Arabic](https://mapbox.github.io/mapbox-gl-language/examples/ar.html)
- [Chinese](https://mapbox.github.io/mapbox-gl-language/examples/zh.html)
- [English](https://mapbox.github.io/mapbox-gl-language/examples/en.html)
- [French](https://mapbox.github.io/mapbox-gl-language/examples/fr.html)
- [Portuguese](https://mapbox.github.io/mapbox-gl-language/examples/pt.html)
- [German](https://mapbox.github.io/mapbox-gl-language/examples/de.html)
- [Spanish](https://mapbox.github.io/mapbox-gl-language/examples/es.html)
- [Japanese](https://mapbox.github.io/mapbox-gl-language/examples/ja.html)
- [Korean](https://mapbox.github.io/mapbox-gl-language/examples/ko.html)
- [Portuguese](https://mapbox.github.io/mapbox-gl-language/examples/pt.html)
- [Russian](https://mapbox.github.io/mapbox-gl-language/examples/ru.html)
- [Chinese](https://mapbox.github.io/mapbox-gl-language/examples/zh.html)
- [Spanish](https://mapbox.github.io/mapbox-gl-language/examples/es.html)

## Supported Styles

Expand Down
34 changes: 34 additions & 0 deletions examples/ja.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Mapbox GL Language</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.css' rel='stylesheet' />
<script src='../index.js'></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>

<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibHVrYXNtYXJ0aW5lbGxpIiwiYSI6ImNpem85dmhwazAyajIyd284dGxhN2VxYnYifQ.HQCmyhEXZUTz3S98FMrVAQ';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v10',
center: [-98, 38.88],
minZoom: 2,
zoom: 3
});
mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.0/mapbox-gl-rtl-text.js');
map.addControl(new MapboxLanguage({
defaultLanguage: 'ja'
}));
</script>

</body>
</html>
34 changes: 34 additions & 0 deletions examples/ko.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Mapbox GL Language</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.css' rel='stylesheet' />
<script src='../index.js'></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>

<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibHVrYXNtYXJ0aW5lbGxpIiwiYSI6ImNpem85dmhwazAyajIyd284dGxhN2VxYnYifQ.HQCmyhEXZUTz3S98FMrVAQ';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v10',
center: [-98, 38.88],
minZoom: 2,
zoom: 3
});
mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.0/mapbox-gl-rtl-text.js');
map.addControl(new MapboxLanguage({
defaultLanguage: 'ko'
}));
</script>

</body>
</html>
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function MapboxLanguage(options) {
}
};
this._excludedLayerIds = options.excludedLayerIds || [];
this.supportedLanguages = options.supportedLanguages || ['en', 'es', 'fr', 'de', 'ru', 'zh', 'ar', 'pt'];
this.supportedLanguages = options.supportedLanguages || ['ar', 'en', 'es', 'fr', 'de', 'ja', 'ko', 'pt', 'ru', 'zh'];
}

function standardSpacing(style) {
Expand Down

0 comments on commit 2babf3b

Please sign in to comment.