-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain1.js
63 lines (54 loc) · 1.12 KB
/
main1.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
53
54
55
56
57
58
59
60
61
62
63
require(["esri/Map", "esri/views/MapView", "esri/Graphic"], (Map, MapView, Graphic) => {
const map = new Map({
basemap: "terrain"
});
var lat = 34.730
var lon = -86.586
const view = new MapView({
center: [lon, lat],
container: "viewDiv",
map: map,
zoom: 8
});
const point = {
type: "point",
longitude: lon,
latitude: lat
};
const pointSymbol = {
type: "simple-marker",
color: "red",
style: "diamond",
width: 12
};
const pointAtt = {
Name: "Huntsville",
Population: "200000",
Founded: "1805",
};
const pointGraphic = new Graphic({
geometry: point,
symbol: pointSymbol,
attributes: pointAtt,
popupTemplate: {
title: "{Name}",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "Name"
},
{
fieldName: "Population"
},
{
fieldName: "Founded"
}
]
}
]
}
});
view.graphics.add(pointGraphic);
});