forked from Beyond-2022/Beyond-2022.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp_search.html
More file actions
618 lines (481 loc) · 30.9 KB
/
temp_search.html
File metadata and controls
618 lines (481 loc) · 30.9 KB
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/d3-sparql@2.0.0/build/d3-sparql.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://d3js.org/d3-collection.v1.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script>
<script src="https://d3js.org/d3-request.v1.min.js"></script>
<!-- <script src="https://unpkg.com/timelines-chart"></script> -->
<!-- <script src="https://unpkg.com/timelines-chart@v2.11.1/dist/timelines-chart.min.js"></script> -->
<script src="assets/js/timelines-chart.min.js"></script>
<meta charset="UTF-8">
<!-- <meta name="viewport" content="width=device-width, inital-scale=1.0"> -->
<title>Beyond Timeline</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="style.css">
<link rel="wikidata icon" href="pic/logo.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link
href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet">
<link rel="stylesheet" href="css/stylesheet.css">
<link rel="stylesheet" href="css/searchButton.css">
<link rel="stylesheet" href="css/filter.css">
<script type="text/javascript">
var b2022_URL;
// var b2022_URL = 'http://localhost:9999/blazegraph/namespace/b2022/sparql';
const queryString = window.location.search; // returns: ?subj=...
const urlParams = new URLSearchParams(queryString);
const subject = urlParams.get('subj'); // isolates subj eg: https://www.wikidata.org/wiki/Q937
//subject can be either
// 'http://virtuoso.adaptcentre.ie/sparql/'
// OR
// 'http://localhost:3030/Beyond_2022/query'
var B2022_query;
// if(localStorage.getItem("typeOfQuery") == null){}
console.log("Subject = "+ subject);
if(subject === "http://localhost:3030/Beyond_2022/query"){
b2022_URL = 'http://localhost:3030/Beyond_2022/query';
B2022_query = `
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://erlangen-crm.org/current/>
PREFIX b2022: <https://kb.beyond2022.ie/>
PREFIX vt: <https://kb.virtualtreasury.ie/>
PREFIX vt_ont: <https://ont.virtualtreasury.ie/ontology#>
select distinct ?normalized_uri ?person_name ?start_date ?end_date ?aoi_label ?type
where {
#Get Birth and Death events and time-spans for each person
?birth rdf:type crm:E67_Birth;
crm:P4_has_time-span ?timespanB;
crm:P98_brought_into_life ?person.
?death rdf:type crm:E69_Death;
crm:P4_has_time-span ?timespanD;
crm:P93_took_out_of_existence ?person.
#Get begin-of-the-begin of Birth as start date and end-of-the-end of Death as end date
?timespanB crm:P82a_begin_of_the_begin ?start_date.
?timespanD crm:P82b_end_of_the_end ?end_date.
#?person crm:P2_has_type <https://ont.virtualtreasury.ie/ontology#Female>.
#Get appellation (surname-forename) of person
?person crm:P1_is_identified_by ?appellation.
?appellation rdfs:label ?person_name.
FILTER(CONTAINS(str(?appellation),"normalized-appellation-surname-forename")).
?person vt_ont:DIB_area_of_interest ?aoi .
?aoi crm:P1_is_identified_by ?aoi_app .
?aoi_app rdfs:label ?aoi_label .
BIND ( STR ( ?person ) AS ?normalized_uri ).
}
ORDER BY ?start_date
LIMIT 50
`;
}
else if(subject == "http://virtuoso.adaptcentre.ie/sparql/"){
b2022_URL = 'http://virtuoso.adaptcentre.ie/sparql/'
B2022_query =`
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://erlangen-crm.org/current/>
PREFIX b2022: <https://kb.beyond2022.ie/>
PREFIX vt: <https://kb.virtualtreasury.ie/>
PREFIX vt_ont: <https://ont.virtualtreasury.ie/ontology#>
PREFIX b2022_ont: <https://kb.beyond2022.ie/ontology#>
#select distinct ?person ?person_name ?start_date ?end_date ?aoi_label
select *
from <http://beyond2022.ie> # <--- remove this if running the query on localhost! Keep only if testing it on virtuoso.adaptcentre.ie
where {
#Get Birth and Death events and time-spans for each person
?birth rdf:type crm:E67_Birth;
crm:P4_has_time-span ?timespanB;
crm:P98_brought_into_life ?person.
?death rdf:type crm:E69_Death;
crm:P4_has_time-span ?timespanD;
crm:P93_took_out_of_existence ?person.
#Get begin-of-the-begin of Birth as start date and end-of-the-end of Death as end date
?timespanB crm:P82a_begin_of_the_begin ?start_date.
?timespanD crm:P82b_end_of_the_end ?end_date.
#Get appellation (surname-forename) of person
?person crm:P1_is_identified_by ?appellation.
?appellation rdfs:label ?person_name.
FILTER(CONTAINS(str(?appellation),"normalized-appellation-surname-forename")).
BIND(?person_name as ?aoi_label).
#?person b2022_ont:DIB_area_of_interest ?aoi .
#?aoi crm:P1_is_identified_by ?aoi_app .
#?aoi_app rdfs:label ?aoi_label .
}
ORDER BY ?start_date
LIMIT 100
`
}
// else if(subject === "http://localhost:3030/Beyond_2022/query/0300-0399"){
else{
b2022_URL = 'http://localhost:3030/Beyond_2022/query';
var start_year = subject.substring(40, 44);
var end_year = subject.substring(45, 49);
console.log("Start Year = "+start_year);
console.log("End Year = "+end_year);
B2022_query = `
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://erlangen-crm.org/current/>
PREFIX b2022: <https://kb.beyond2022.ie/>
PREFIX vt: <https://kb.virtualtreasury.ie/>
PREFIX vt_ont: <https://ont.virtualtreasury.ie/ontology#>
select distinct ?person_name ?start_date ?end_date ?aoi_label
where {
#Get Birth and Death events and time-spans for each person
?birth rdf:type crm:E67_Birth;
crm:P4_has_time-span ?timespanB;
crm:P98_brought_into_life ?person.
?death rdf:type crm:E69_Death;
crm:P4_has_time-span ?timespanD;
crm:P93_took_out_of_existence ?person.
#Get begin-of-the-begin of Birth as start date and end-of-the-end of Death as end date
?timespanB crm:P82a_begin_of_the_begin ?start_date.
?timespanD crm:P82b_end_of_the_end ?end_date.
FILTER (?start_date > "`+start_year+`-01-01"^^xsd:date).
FILTER (?start_date <= "`+end_year+`-01-01"^^xsd:date).
#Get appellation (surname-forename) of person
?person crm:P1_is_identified_by ?appellation.
?appellation rdfs:label ?person_name.
FILTER(CONTAINS(str(?appellation),"normalized-appellation-surname-forename")).
?person vt_ont:DIB_area_of_interest ?aoi .
?aoi crm:P1_is_identified_by ?aoi_app .
?aoi_app rdfs:label ?aoi_label .
}
ORDER BY ?start_date
`;
}
var queryName = "Life Timeline";
function addMonth(date, month)
{
var result = new Date(date);
result.setMonth(result.getMonth() + month);
return result;
}
function renameFiles(arr){
var count = {};
arr.forEach(function(x,i) {
if ( arr.indexOf(x) !== i ) {
var c = x in count ? count[x] = count[x] + 1 : count[x] = 1;
var j = c + 1;
var k = x + '(' + j + ')';
while( arr.indexOf(k) !== -1 ) k = x + '(' + (++j) + ')';
arr[i] = k;
}
});
return arr;
}
d3.sparql(b2022_URL, B2022_query).then(function (data) {
console.log(data);
data.forEach(function (arrayItem) { // Edit deathData to have start & end date with oName
if (typeof arrayItem === "object") {
arrayItem["start"] = arrayItem.start_date; //start is obj date
// arrayItem["end"] = addMonth(arrayItem.start_date, 1); // add extra month to end date if not specified to make it visible on chart
arrayItem["end"] = arrayItem.end_date;
arrayItem["oName"] = arrayItem.person_name; //oName is pName
arrayItem["pName"] = arrayItem.aoi_label;
arrayItem["uriName"] = arrayItem.normalized_uri;
}
});
function getRandomData(ordinal = false) {
var groups = 1;
const NGROUPS = groups;
var MAXTIME = data[0].start;
var MINTIME = data[0].start; //assume start date of first entry is earliest date
// Need to sort array based on start-date
data.forEach(function (arrayItem) { // find minimum date of query
if (arrayItem.start < MINTIME) {
MINTIME = arrayItem.start;
}
if (arrayItem.start > MAXTIME) {
MAXTIME = arrayItem.start;
}
});
const sortedData = data.sort((a, b) => Date.parse(a.start) - Date.parse(b.start))
data = sortedData;
function getFields(input, field) {
var output = [];
for (var i=0; i < input.length ; ++i)
output.push(input[i][field]);
return output;
}
var data_names = getFields(data, "oName");
// console.log(data_names);
var sorted_names = renameFiles(data_names);
// console.log(sorted_names);
// var data_person_names = getFields(data, "person_name");
// // console.log(data_names);
// var sorted_person_names = renameFiles(data_person_names);
result = data.map(function(currentObject, index) {
return {
aoi_label: currentObject.aoi_label,
end:currentObject.end,
end_date:currentObject.end_date,
normalized_uri:currentObject.normalized_uri,
pName:currentObject.pName,
start:currentObject.start,
start_date:currentObject.start_date,
uriName:currentObject.uriName,
person_name:currentObject.person_name,
// person_name:sorted_person_names[currentObject],
oName:sorted_names[index]
};
});
console.log(result);
// data.person_name = renameFiles(data.person_name);
data = result;
// console.log(data);
// data = sorted_data;
// const sorted_data = renameFiles(data);
return [...Array(NGROUPS).keys()].map(i => ({
//group: document.getElementById('textID').value, //left hand side of grid, need to make query name, currently set as data[0].oName
group: queryName,
data: getGroupData()
}));
// the group is the subject -- Albert Einstein = g1
function getGroupData() { //called once
//console.log(data);
return [...Array(data.length).keys()].map(i => ({
label: data[i].oName, //right hand side of graph
// label: data[i].uriName,
data: getSegmentsData(i)
}));
//
//ie the bars in the timeline
function getSegmentsData(index) //called data.length times
{
//console.log("getSegments called");
//const nSegments = data.length,
const nSegments = 1,
segMaxLength = Math.round(((new Date()) - MINTIME) / nSegments);
// console.log(segMaxLength);
let runLength = MINTIME; // earliest date in timeline?
return [...Array(nSegments).keys()].map(i => {
start = data[index].start, //every entry has a start date
end = data[index].end ? data[index].end : new Date(); //set end date to end date if present otherwise set to current date
runLength = new Date(start.getTime() + segMaxLength);
return {
timeRange: [start, end], // shows start date to end date on hover
val: data[index].pName, // shows pName on hover
//val: "Interests: "+ data[index].pName, // shows pName on hover
// val: "Lifetime", // shows pName on hover
duration: data[index].start + " - " + data[index].end,
// labelVal: data[index].oName + " ( "+data[index].pName + " )" //is optional - only displayed in the labels
// labelVal: "<img src='https://dgraux.github.io/IMG_20180513_115203.jpg' alt='Appearance as of May 2018' width='95%' align='right'></img>"
};
});
}
}
} //red orange yellow green brown purple pink blue
// let scale = d3.scaleOrdinal(['#E67B7B', '#FF8F00', '#FFF300', '#6AD96A', '#9D6F6F', '#726AD9', '#C16AD9', '#6A8AD9']); // red, orange, yellow, green, blue, lilac, purple
let scale = d3.scaleOrdinal(['#dff32a', '#78850a', '#FFF300', '#0a8575', '#3867e7', '#f55e83', '#e4990f', '#e46f0f']);
function segmentClick(segment) {
console.log(segment.target.__data__.label);
var segmentName = segment.target.__data__.label;
var queryCode;
for (i = 0; i < data.length; i++) {
if (data[i].oName == segmentName) {
queryCode = data[i].obj;
break;
}
}
console.log(queryCode);
// window.open('search.html?subj=http://localhost:3030/Beyond_2022/query', '_self');
window.open('search.html?subj='+subject,'_self');
}
TimelinesChart()
.rightMargin(200) // 200 pixels
// .rightMargin(0)
.leftMargin(100)
.maxHeight(1920)
.maxLineHeight(17)
.topMargin(40)
.data(getRandomData(true))
.onSegmentClick(segmentClick)
//.sortChrono([true]) //Places in order of end date if true
.zQualitative(true) //https://github.com/vasturiano/timelines-chart for more details
.zColorScale(scale) // Uses scale above to color each oName
.zScaleLabel('Consumo')
(document.getElementById('chart_div'));
}); //end of B2022_Death_Query
</script>
</head>
<body>
<header class="site-header site2-header site3-header header-default header-sticky animated">
<div class="container-fluid">
<div class="site2-header1">
<div class="row">
<div class="col-md-2 fix-logo">
<div class="wrapper-logo">
<a href="index.html" class="logo-default"><img src="pic/logo.png" height="64"
alt="AYF" /></a>
</div>
</div>
<div class="col-md-4 col-md-push-6 fix-social">
<a href="https://github.com/Beyond-2022/Beyond-2022.github.io.git" class="buy-ticket"><img
src="pic/GitHub-Logo.png" alt="AYF" /></a>
</div>
<div class="col-md-6 col-md-pull-4 fix-menu">
<div class="row">
<nav class="main-menu">
<ul class="nav-bar">
<li><a href="index.html">home</a>
</li>
<li><a href="about.html">About</a>
</li>
<li><a href="contributor.html">Team</a>
</li>
<li><a href="something_fun.html">Find by Century</a>
</li>
<li><a href="slider.html">Find by Years</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="page-heading">
<h1 class="entry-title"></h1>
<h3 style="color: white;">What am I seeing?</h3>
<h5 style="color: white;">Using the Record Treasury at the Public Record Office of Ireland stored seven centuries of Irish records, </h5>
<h5 style="color: white;">you see the life span of people in the form of a timelines chart. </h5>
<!-- <h5 style="color: white;">Select the area with your cursor to zoom-in on the timeline.</h5> -->
<ul class="entry-breadcrumb">
</ul>
</div>
<br> </br>
<!-- <div id="Search" class="searchbar">
<input type="text" class="searchbox" placeholder="Enter a query..." id="text"
style="width: 60%; height: 35px " />
<input type='hidden' id='textID' />
-->
<!-- <sub href="Submit_Button" input type="button" class="sub" id="btn" value="Submit"
onClick="javascript: window.open('search.html?subj='+subject, '_self');">
Refresh
</sub> -->
<!-- <br> </br>
<div id="chart_div" style="overflow-x: scroll; overflow-y: scroll; height: 100%; width: 100%;font-size: 11px; ">
</div> -->
<!-- <div class="controls">
<label>Filter:</label>
<button class="filter" data-filter=".category-1">Category 1</button>
<button class="filter" data-filter=".category-2">Category 2</button>
<button class="filter" data-filter=".category-3">Category 3</button>
<button onclick="$('#Container').mixItUp('filter','')">Reset</button>
</div>
-->
<sub href="Submit_Button" input type="button" class="sub" id="btn" value="Submit"
onClick="javascript:
var container = document.getElementById('filter-container');
if(f1.checked){
console.log('true');
}else{
console.log('false');
}
">
Refresh
</sub>
<br> </br>
<button id="filter-button" class="button">Filter</button>
<div id="filter-container" class="filters">
<ul class="filters__list">
<li>
<input id="f1" type="checkbox" />
<label for="f1">Filter 1</label>
</li>
<li>
<input id="f2" type="checkbox" />
<label for="f2">Filter 2</label>
</li>
<li>
<input id="f3" type="checkbox" />
<label for="f3">Filter 3</label>
</li>
<li>
<input id="f4" type="checkbox" />
<label for="f4">Filter 4</label>
</li>
<li>
<input id="f5" type="checkbox" />
<label for="f5">Filter 5</label>
</li>
</ul></div>
<script>
var button = document.getElementById("filter-button");
var container = document.getElementById("filter-container");
var input = document.querySelectorAll("input");
button.onclick = function (e) {
e.stopPropagation();
if (container.classList.contains("filters--active")) {
container.classList.remove("filters--active");
} else {
container.classList.add("filters--active");
}
};
container.onclick = function (e) {
e.stopPropagation();
};
window.onclick = function () {
container.classList.remove("filters--active");
};
console.log(input);
for (var i = 0; i < input.length; i++) {
var currentInput = input[i];
currentInput.onclick = function () {
var isChecked = false;
for (var j = 0; j < input.length; j++) {
if (input[j].checked) {
isChecked = true;
break;
}
}
if (isChecked) {
button.classList.add("button--highlight");
} else {
button.classList.remove("button--highlight");
}
};
}
</script>
<!-- <div id="Container" class="container">
<div class="fail-message"><span>No items were found matching the current filters.</span></div>
<div class="mix category-1 category-2"></div>
<div class="mix category-2"></div>
<div class="mix category-1 category-2"></div>
<div class="mix category-1 category-3"></div>
<div class="mix category-3"></div>
<div class="gap"></div>
<div class="gap"></div>
</div>
-->
<script src="assets/js/Nav.js"></script>
<script src="assets/js/Search.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/d3-sparql@2.0.0/build/d3-sparql.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://d3js.org/d3-collection.v1.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script>
<script src="https://d3js.org/d3-request.v1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
crossorigin="anonymous"></script>
<script type="text/javascript" src="assets/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/lightgallery.min.js"></script>
<script type="text/javascript" src="assets/js/parallax.min.js"></script>
<script type="text/javascript" src="assets/js/main.js"></script>
</body>
</html>
<!-- segment.target.__data__.labelVal = "<div id='mapid' style='width: 600px; height: 400px;'></div> <script> var mymap = L.map('mapid').setView([51.505, -0.09], 13); L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {maxZoom: 18, id: 'mapbox/streets-v11',tileSize: 512,zoomOffset: -1}).addTo(mymap); L.marker([51.5, -0.09]).addTo(mymap) .bindPopup('<b>Hello world!</b><br />I am a popup.').openPopup(); L.circle([51.508, -0.11], 500, { color: 'red',fillColor: '#f03',fillOpacity: 0.5}).addTo(mymap).bindPopup('I am a circle.'); L.polygon([ [51.509, -0.08],[51.503, -0.06],[51.51, -0.047]]).addTo(mymap).bindPopup('I am a polygon.'); var popup = L.popup(); function onMapClick(e) {popup .setLatLng(e.latlng) .setContent('You clicked the map at ' + e.latlng.toString()) .openOn(mymap);} mymap.on('click', onMapClick); </script>"; -->