-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_page.js
52 lines (42 loc) · 1.5 KB
/
start_page.js
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
require(["esri/config", "esri/Map", "esri/views/MapView", "esri/Graphic", "esri/layers/GraphicsLayer"], function(esriConfig, Map, MapView, Graphic, GraphicsLayer) {
esriConfig.apiKey = "AAPK5be3f01c97514789abf75cecf9eed17aYS60cPwCtzEzXaZy2u42oARgeKjVAUOk-0wu97XRw_4BrzTh8VKPB8DAT4vkvk7H";
const map = new Map({
basemap: "gray-vector" // Basemap layer service
});
const view = new MapView({
map: map,
center: [-119, 33.5], // Longitude, latitude
zoom: 6, // Zoom level
container: "viewDiv" // Div element
});
const graphicsLayer = new GraphicsLayer();
map.add(graphicsLayer);
var longitudes = [];
var latitudes = [];
d3.csv("1960.csv").then(function(data) {
for(var i = 0; i < data.length; i++) {
// longitudes.push(data[i]['longitude'])
// latitudes.push(data[i]['latitude'])
var longitude_val = +data[i]['longitude'];
var latitude_val = +data[i]['latitude'];
const point = { // Create a point
type: "point",
longitude: longitude_val,
latitude: latitude_val
};
const simpleMarkerSymbol = {
type: "simple-marker",
color: [226, 119, 40], // Orange
outline: {
color: [255, 255, 255], // White
width: 1
}
};
const pointGraphic = new Graphic({
geometry: point,
symbol: simpleMarkerSymbol
});
graphicsLayer.add(pointGraphic);
}
});
});