a b/src/cut-viewer-load.js
1
const fragmentId = document.URL.slice(-53)
2
3
const markersSource = [
4
//!!! lat is horizontal(x), lng is vertical(y)!!!
5
    {y: 312, x: 5723},
6
    {y: 476, x: 6319},
7
    {y: 861, x: 5907},
8
    {y: 1688, x: 6101},
9
    {y: 2517, x: 6856},
10
    {y: 2723, x: 6731},
11
    {y: 2780, x: 6567},
12
    {y: 2425, x: 6330},
13
    {y: 4475, x: 7110},
14
    {y: 4684, x: 6744},
15
    {y: 4744, x: 6593},
16
    {y: 4869, x: 6576},
17
    {y: 5372, x: 6519},
18
    {y: 5895, x: 6423},
19
    {y: 5677, x: 6652},
20
    {y: 6038, x: 5696},
21
    {y: 6026, x: 5106},
22
    {y: 3692, x: 3266},
23
    {y: 3654, x: 2135},
24
    {y: 3456, x: 1040},
25
    {y: 3648, x: 326},
26
    {y: 4929, x: 823},
27
    {y: 5117, x: 794},
28
    {y: 6364, x: 305},
29
    {y: 6283, x: 230},
30
    {y: 5048, x: 309},
31
    {y: 3722, x: 895},
32
    {y: 1541, x: 4073},
33
    {y: 123, x: 4256},
34
    {y: 625, x: 774},
35
    {y: 1142, x: 790},
36
    {y: 2125, x: 765},
37
    {y: 2303, x: 496},
38
    {y: 2579, x: 747},
39
    {y: 2510, x: 941},
40
    {y: 3698, x: 66},
41
    {y: 4396, x: 776},
42
    {y: 4553, x: 35},
43
    {y: 5021, x: 774},
44
    {y: 4247, x: 1447},
45
    {y: 4130, x: 1665},
46
    {y: 3967, x: 1794},
47
    {y: 3322, x: 1654},
48
    {y: 3032, x: 1538},
49
    {y: 2942, x: 2084},
50
    {y: 2020, x: 1298},
51
    {y: 1207, x: 1584},
52
    {y: 1697, x: 2103},
53
    {y: 1736, x: 2140},
54
    {y: 1684, x: 2305}
55
];
56
57
$(document).ready(() => {
58
    $('.fragmentId').append(fragmentId)
59
    $('#downloadfragment').append(`<a href="https://krang-dataset.website.yandexcloud.net/${fragmentId}.tiff">Скачать фрагмент ${fragmentId}.tiff</a>`);
60
61
    markersSource.forEach(point => {
62
        createMarker(point.x, point.y)
63
    });
64
});
65
66
//init leaflet.js
67
var imageUrl = `https://krang-dataset.website.yandexcloud.net/cuts/${fragmentId}.jpg`
68
var imageBounds = [[0, 0], [7168, 7168]];
69
const map = L.map('map', {
70
    crs: L.CRS.Simple,
71
    minZoom: -2,
72
    maxZoom: 1,
73
    maxBounds: imageBounds
74
})
75
var image = L.imageOverlay(imageUrl, imageBounds).addTo(map);
76
map.fitBounds(imageBounds)
77