-
Notifications
You must be signed in to change notification settings - Fork 432
/
Copy pathdemo.html
36 lines (36 loc) · 2.56 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Multi-language support</title>
<link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
<link rel="stylesheet" type="text/css" href="demo.css" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="../template.css" />
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-mapevents.js"></script>
</head>
<body id="markers-on-the-map">
<div class="page-header">
<h1>Multi-language support</h1>
<p>Display a map with labels in a foreign language</p>
</div>
<p>This example displays a movable map initially centered over <b>Hong Kong</b> <i>(22.2917°N, 114.1872°E)</i> with map labels in simplified Chinese.</i></p>
<div id="map"></div>
<h3>Code</h3>
<p>A reference to the base map tile service is obtained using the <code>H.service.Platform</code>.
Alternate languages can be requested by adding the <code>lg</code> parameter to the tile requests.
That is done by calling createTileLayer method. 5th argument is list of key/value parameters which are
passed to the map tile service when requesting each tile.
A list of all supported map languages can be found in the API References of the underlying service used: <a href="https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-base-maptile.html">HERE Map Tile API</a>
and <a href="https://developer.here.com/documentation/vector-tiles-api/dev_guide/topics/languages.html">HERE Vector Tile API</a> </p>
<p>It is possible to specify map language for all layers at once when using <code>H.service.Platform.createDefaultLayers</code> method.</p>
<p>Language of the UI controls can be specified when calling <code>H.ui.UI.createDefault</code> method.
3rd argument is either a supported language code or a custom <code>H.ui.i18n.Localization object</code>.</p>
<script type="text/javascript" src='demo.js'></script>
</body>
</html>