-
Notifications
You must be signed in to change notification settings - Fork 130
/
geojson.html
49 lines (44 loc) · 1.28 KB
/
geojson.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
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title>GeoJson 練習</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 9,
center: {lat: 25.047886, lng: 121.516950}
});
// Load GeoJSON.
map.data.loadGeoJson(
// 可輸入資料網址 或直接 輸入 GeoJson
// 多邊形
//"http://www.geologycloud.tw/data/zh-tw/liquefaction?area=%E8%87%BA%E5%8C%97&classify=%E9%AB%98%E6%BD%9B%E5%8B%A2&all=true"
// 線- (參考 GIS-T 的資料)
//
// 點
//"https://gist-geo.motc.gov.tw/Api/Locator/V1/LandmarkLocation/%E4%BA%A4%E9%80%9A%E9%83%A8/GeoJSON"
);
// 範例來源
// https://developers.google.com/maps/documentation/javascript/datalayer?hl=zh-tw#load_geojson
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?callback=initMap&key=AIzaSyCE3rhrAg9_Nuxr1i-lfwTnbZ48ECkc-9c">
</script>
</body>
</html>