-
Notifications
You must be signed in to change notification settings - Fork 0
/
indexBACKUP.html
225 lines (187 loc) · 6.67 KB
/
indexBACKUP.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!-- SOURCE: https://developers.google.com/maps/documentation/javascript/examples/advanced-markers-accessibility -->
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>Hello, Kyoto</title>
<style>
div.content, .banner {
border: solid #e46b85 2px;
max-width: 900px;
align-content: center;
background-color: white;
margin: auto;
padding: 20px;
float: center;
margin-bottom: 10px;
height: auto;
}
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#viewDiv {
padding: 0;
margin: 0;
height: 75%;
width: 100%;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 100%;
margin: 0;
padding: 0;
background-color: #F9AABB;
float: center;
font-family: 'Lucida Sans Regular', sans-serif;
}
.title {
font-weight: bold;
}
#infowindow-content {
display: none;
}
#map #infowindow-content {
display: inline;
}
h1, p { color: #25242A; text-align: center;}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.28/esri/themes/light/main.css">
<script src="https://js.arcgis.com/4.28/"></script>
<script>
//IMPORT REQUIRED MODULES
require(["esri/config", "esri/Map", "esri/views/MapView", "esri/Graphic", "esri/layers/GraphicsLayer", "esri/layers/FeatureLayer", "esri/layers/GeoJSONLayer", "esri/views/layers/GeoJSONLayerView"], function(esriConfig, Map, MapView, Graphic, GraphicsLayer, GeoJSONLayer, FeatureLayer, GeoJSONLayerView) {
//SET KEY FOR ACCESS
esriConfig.apiKey = "AAPKf39b27d6d221447ca21fadc43cc080d4CG_Kd1VG3VI-i0wDMbTlWQBdQqiClnZs5oPxl-Rzark8PxcdF0wXd-qVSPS7d07N";
//SET UP BASE LAYER
const map = new Map({
basemap: "arcgis/topographic" // basemap styles service
});
//SET UP VIEW AND MAP FOCUS
const view = new MapView({
map: map,
center: [135.7354089, 35.0175169], // Longitude, latitude
zoom: 13, // Zoom level
container: "viewDiv" // Div element
});
//CREATE GRAPHICS LAYER
const graphicsLayer = new GraphicsLayer();
map.add(graphicsLayer);
//ADDITIONAL DESCRIPTION POPUP
const popupTemplate = {
title: "{Name}",
content: "{Description}"
};
//CREATE POINT
const point = {
type: "point",
longitude: 135.7463893,
latitude: 34.9864358
};
const simpleMarkerSymbol = {
type: "simple-marker",
color: [249,170,187], // Light pink
outline: {
color: [211,115,179], // Darker pink
width: 1
}
};
const attributesP = {
Name: "Place",
Description: "Umekoji Park has lovely walking areas and an aquarium."
};
//ADD POINT GRAPHIC
const pointGraphic = new Graphic({
geometry: point,
symbol: simpleMarkerSymbol,
attributes: attributesP,
popupTemplate: popupTemplate
});
graphicsLayer.add(pointGraphic);
// CREATE POLYLINE GEOMETRY
const polyline = {
type: "polyline",
paths: [
[135.7625979, 35.0485703], //Longitude, latitude
[135.7604489, 35.0376503], //Longitude, latitude
[135.7635486, 35.0230347] //Longitude, latitude
]
};
const simpleLineSymbol = {
type: "simple-line",
color: [211,115,179], // darker pink
width: 2
};
const attributesPL = {
Name: "Trip",
Description: "Quiet walk in beautiful gardens and world protected areas filled with nature."
};
// POLYLINE
const polylineGraphic = new Graphic({
geometry: polyline,
symbol: simpleLineSymbol,
//POP UP ADDITION
attributes: attributesPL,
popupTemplate: popupTemplate
});
graphicsLayer.add(polylineGraphic);
// CREATE POLYGON GEOMETRY
const polygon = {
type: "polygon",
rings: [
[135.6744587, 35.0090085], //Longitude, latitude //Monkey park
[135.6685515, 35.0170101], //Longitude, latitude //Bamboo forest
[135.674276, 35.0166128], //Longitude, latitude //tenryu-ji
[135.6781063, 35.0152475], //Longitude, latitude //kimono forest
[135.6799142, 35.0120795] //Longitude, latitude //island park
]
};
//FILL POLYGON
const simpleFillSymbol = {
type: "simple-fill",
color: [249, 170, 187, .75], // light pink, opacity 75%
outline: {
color: [211, 115,179], //dark pink
width: 1
}
};
//POLYGON POPUP
const attributesPG = {
Name: "Area",
Description: "Arashiyama is a good area to walk around."
};
// POLYGON GRAPHIC ADD
const polygonGraphic = new Graphic({
geometry: polygon,
symbol: simpleFillSymbol,
//POP UP ADDITION
attributes: attributesPG,
popupTemplate: popupTemplate
});
graphicsLayer.add(polygonGraphic);
//WHICH LAYER WILL WORK FIRST?
//THROW IN A geojson LAYER
const geojsonlayer = new GeoJSONLayer({
url: "https://github.com/catamaralina/geom99wk4/blob/main/flowerk.geojson",
});
map.add(geojsonlayer); // adds the layer to the map
//THROWN IN A feature LAYER
const featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/4TKcmj8FHh5Vtobt/arcgis/rest/services/Kyoto_Flower/FeatureServer/0",
});
map.add(featureLayer);
});
</script>
</head>
<body>
<div class="banner">
<h1>Hello, Kyoto 💕 </h1> <!--Kyoto-->
<p>🌻 Place: Umekoji Park with Kyoto Aquarium in it.</p>
<p>🌷 Trip: Day starting with Kyoto Botanical Gardens, then walking in Kamagawa Park along the river, a world protected area, and stopping to look at herons and other wildlife. All the while heading towards Kyoto National Garden to end the day.</p>
<p>🌹 Area: Arashiyama is a good place to wander and see what is interesting. Parks to walk in, monkeys to feed, bridges to cross, food to eat.</p>
<p> 🌿 🌸 💮 🌺 🌸 🍁 🌿 </p>
</div>
<div class="content">
<div id="viewDiv"></div>
</div>
</body>
</html>