/
js_1.html
93 lines (79 loc) · 2.97 KB
/
js_1.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>GeoJSONLayer | Sample | ArcGIS API for JavaScript 4.18</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.18/"></script>
<script>
require(["esri/Map", "esri/layers/GeoJSONLayer", "esri/views/MapView"], function (
Map,
GeoJSONLayer,
MapView
) {
// If GeoJSON files are not on the same domain as your website, a CORS enabled server
// or a proxy is required.
const url = "https://raw.githubusercontent.com/Shai2u/simualtion_nov_2020_binder/main/json/bldgs_geojson_feb_8.geojson";
// Paste the url into a browser's address bar to download and view the attributes
// in the GeoJSON file. These attributes include:
// * mag - magnitude
// * type - earthquake or other event such as nuclear test
// * place - location of the event
// * time - the time of the event
// Use the Arcade Date() function to format time field into a human-readable format
// const renderer = {
// type: "simple",
// field: "mag",
// symbol: {
// type: "simple-marker",
// color: "orange",
// outline: {
// color: "white"
// }
// },
// visualVariables: [{
// type: "size",
// field: "mag",
// stops: [{
// value: 2.5,
// size: "4px"
// },
// {
// value: 8,
// size: "40px"
// }
// ]
// }]
// };
const geojsonLayer = new GeoJSONLayer({
url: url,
copyright: "USGS Earthquakes",
//renderer: renderer //optional
});
const map = new Map({
basemap: "gray-vector",
layers: [geojsonLayer]
});
const view = new MapView({
container: "viewDiv",
center: [-168, 46],
zoom: 2,
map: map
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>