Skip to content

Commit 06fed2a

Browse files
authored
Update openlayers.html
1 parent 74fd3c9 commit 06fed2a

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

docs/zh-TW/ using-tiles /openlayers.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="zh-TW">
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
@@ -12,12 +12,12 @@
1212
margin: 0;
1313
}
1414
#map {
15-
/* configure the size of the map */
15+
/* 設定地圖的大小 */
1616
width: 100%;
1717
height: 100%;
1818
}
1919
</style>
20-
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
20+
<!-- 以下的行是為了舊的環境,例如 Internet Explorer Android 4.x -->
2121
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
2222
<script src="http://openlayers.org/en/v3.18.2/build/ol.js"></script>
2323
</head>
@@ -28,9 +28,9 @@
2828
var map = new ol.Map({
2929
layers: [
3030
new ol.layer.Tile({
31-
// This illustrates a custom tiles source but for using
32-
// official OpenStreetMap server new ol.source.OSM()
33-
// instead of new ol.source.XYZ(...) is enough
31+
// 這描述自訂圖磚來源但使用
32+
// 官方開放街圖伺服器新 ol.source.OSM()
33+
// 而非新 ol.source.XYZ(...) 已經足夠
3434
source: new ol.source.XYZ({
3535
attributions: [
3636
ol.source.OSM.ATTRIBUTION,
@@ -44,12 +44,12 @@
4444
})
4545
],
4646
controls: ol.control.defaults({
47-
// Set to display OSM attributions on the bottom right control
47+
// 設定在右下角顯示 OSM 署名
4848
attributionOptions: {
4949
collapsed: false
5050
}
5151
}).extend([
52-
new ol.control.ScaleLine() // Add scale line to the defaults controls
52+
new ol.control.ScaleLine() // 在預設位置新增比例尺
5353
]),
5454
target: 'map',
5555
view: new ol.View({
@@ -58,15 +58,15 @@
5858
})
5959
});
6060

61-
// Add vector layer with a feature and a style using an icon
61+
// 在向量圖層新增圖徵與圖示樣式
6262
var vectorLayer = new ol.layer.Vector({
6363
source: new ol.source.Vector({
6464
features: [
6565
new ol.Feature({
6666
geometry: new ol.geom.Point(
6767
ol.proj.fromLonLat([0, 0])
6868
),
69-
name: 'The center of the world'
69+
name: '全世界的中心'
7070
})
7171
]
7272
}),
@@ -82,7 +82,7 @@
8282

8383
map.addLayer(vectorLayer);
8484

85-
// Overlay to manage popup on the top of the map
85+
// 套疊來管理地圖上跳出選單
8686
var popup = document.getElementById('popup');
8787
var overLay = new ol.Overlay({
8888
element: popup,
@@ -91,7 +91,7 @@
9191

9292
map.addOverlay(overLay);
9393

94-
// Manage click on the map to display/hide popup
94+
// 管理地圖上點擊行為來顯示/隱藏跳出選單
9595
map.on('click', function(e) {
9696
var info = [];
9797
map.forEachFeatureAtPixel(e.pixel, function (feature) {

0 commit comments

Comments
 (0)