-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
69 lines (59 loc) · 1.81 KB
/
index.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
64
65
66
67
68
69
import Map from "https://js.arcgis.com/4.18/@arcgis/core/Map.js";
import MapView from "https://js.arcgis.com/4.18/@arcgis/core/views/MapView.js";
import FeatureLayer from "https://js.arcgis.com/4.18/@arcgis/core/layers/FeatureLayer.js";
import VectorTileLayer from 'https://js.arcgis.com/4.18/@arcgis/core/layers/VectorTileLayer.js';
import esriConfig from 'https://js.arcgis.com/4.18/@arcgis/core/config.js';
import Basemap from 'https://js.arcgis.com/4.18/@arcgis/core/Basemap.js';
esriConfig.apiKey = "AAPK910bc52162d04535b4b2e399d655b842-B8-L-B-bSHMrLN2KVLmjffN-wrL_S3hXWvzpGoUceNidwHU5YxKxYF9dcKDp9xH";
var vectorTileLayer = new VectorTileLayer({
portalItem: {
id: 'cbbcb78eb4d94b62879e1384b67e0e08'
}
});
const basemap = new Basemap({
baseLayers: [vectorTileLayer]
});
const map = new Map({
basemap: basemap
});
const view = new MapView({
map: map,
container: "viewDiv",
center: [-3.690504, 41.670161],
zoom: 6
});
const hashtag = {
type: "picture-marker",
url: './images/cabeza.svg',
width: 40,
height: 40
};
var speakersRenderer = {
type: "simple",
symbol: hashtag
};
const speakersLayer = new FeatureLayer({
url: "https://services5.arcgis.com/hZQQbQb2B2y1Wd2F/arcgis/rest/services/SpeakersDeCodenoobsconf/FeatureServer",
renderer: speakersRenderer,
popupTemplate: {
title: "<b>{Nombre}</b>",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "Título",
label: "<i class='far fa-comment'></i>"
},
{
fieldName: "Twitter",
label: "<i class='fab fa-twitter'></i>"
},
]
}]
}
});
map.add(speakersLayer);
view.when(() => {
document.querySelector('.esri-attribution__powered-by a').innerHTML = `<a href="https://developers.arcgis.com/" target="_blank">ESRI</a>`;
});