-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
609 lines (516 loc) · 27.6 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<!--meta charset="UTF-8"-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RABA import</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="origin-when-crossorigin">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" >
<link rel="icon" href="favicon.ico" type="image/x-icon" >
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.6.0/leaflet.css" >
<link rel="stylesheet" href="L.Control.MousePosition.css" >
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" >
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" >
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" >
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://bmcbride.github.io/bootleaf/assets/leaflet-groupedlayercontrol/leaflet.groupedlayercontrol.css">
<link rel="stylesheet" href="https://bmcbride.github.io/bootleaf/assets/css/app.css">
<!-- <script src="//bmcbride.github.io/bootleaf/assets/leaflet-groupedlayercontrol/leaflet.groupedlayercontrol.js"></script> -->
<!-- <script src="//bmcbride.github.io/bootleaf/assets/js/app.js"></script> -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.6.0/leaflet.js"></script>
<script type="text/javascript" src="leaflet-providers.js"></script>
<script type="text/javascript" src="zlib_and_gzip.min.js"></script>
<script type="text/javascript" src="shp.js"></script>
<script type="text/javascript" src="catiline.js"></script>
<script type="text/javascript" src="leaflet.shpfile.js"></script>
<script type="text/javascript" src="L.Control.MousePosition.js"></script>
<script type="text/javascript" src="leaflet-hash.js"></script>
<script type="text/javascript" src="josmRemote.js"></script>
<!-- https://admin.tilehosting.com/geocoding/ -->
<script src="https://cdn.klokantech.com/osmnames/v1/autocomplete.js"></script>
<link href="https://cdn.klokantech.com/osmnames/v1/autocomplete.css" rel="stylesheet" />
<style>
html,body{height:100%}
.container-fluid {
height:100%;
xxxoverflow-y: hidden;
xxxwidth:100%;
xxxmin-width:100%;
xxpadding:0px;
}
#map {
width:100%;
min-width:100%;
height:100%;
min-height:100px;
}
.ac-renderer { z-index: 1050;}
</style>
<script type="text/javascript">
//<!-- <![CDATA[
//this should be dynamically updated:
var SplitsAvailable = [ 29, 36, 37, 42, 43, 49, 393, 419, 420, 446, 1447, 1491, 1492, 1535, 3528, 3543, 3544, 3559 ];
//var dataBaseUrl="http://data.raba.openstreetmap.si/RabaSplits_20161231_EPSG4326/";
//var dataBaseUrl="http://dev.openstreetmap.de/osm.si/RabaSplits_20170131_EPSG4326/";
var dataBaseUrl = location.origin + "/RabaSplits_latest_EPSG4326/";
function buildDialog(splitId, layer) {
var str= "Split <b>"+splitId +"<\/b><br>";
//str += "<br/>Zoom";
//str += "<br/><a href=\"javascript:showSplit("+splitId+")\">Show<\/a>";
//str += "<br/><i title=\"Show\" onclick=\"showSplit("+splitId+")\" class=\"fa fa-eye fa-2x\"><\/i>";
//str += "<br/><i title=\"Show\" onclick=\"showSplit("+splitId+");\" class=\"fa fa-eye fa-2x fa-border\"><\/i>";
//str += " <button title=\"Show\" onclick=\"showSplit("+splitId+");\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-eye fa-2x\"><\/i><\/button>";
str += "<div class=\"btn-group\" style=\"width:160px\">";
//str += "<a title=\"Fit to screen\" onclick=\"console.log(layer);//showSplit("+splitId+");\" class=\"btn btn-default\"><i class=\"fa fa-2x fa-expand\"><\/i><\/a>";
str += "<a title=\"Show\" onclick=\"showSplit("+splitId+");\" class=\"btn btn-default\"><i class=\"fa fa-2x fa-eye\"><\/i><\/a>";
//<i title=\"Show\" onclick=\"showSplit("+splitId+");\" class=\"fa-border\"><\/i>";
//str += " <button title=\"Load to JOSM\" onclick=\"josmImportWithMeta("+splitId+")\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-cloud-download fa-2x\"><\/i><\/button>";
str += "<a title=\"Load FULL to JOSM\" onclick=\"josmImportWithMeta("+splitId+")\" class=\"btn btn-default\"><i class=\"fa fa-2x fa-cloud-download\"><\/i><\/a>";
//str += "<a title=\"Load only Forest and Scrub to JOSM\" onclick=\"josmImportWithMetaForest("+splitId+")\" class=\"btn btn-default\"><i class=\"fa fa-2x fa-tree\"><\/i><\/a>";
//str += "<a title=\"Load to JOSM\" onclick=\"josmImportWithMeta("+splitId+")\" class=\"btn btn-default\"><i class=\"fa fa-2x fa-edit\"><\/i><\/a>";
//str += "<br/><a href=\"javascript:josmImportWithMeta("+splitId+")\">Load to JOSM<\/a>";
//str += "<a title=\"Delete from map\" onclick=\"//josmImportWithMeta("+splitId+")\" class=\"btn btn-default\"><i class=\"fa fa-2x fa-trash\"><\/i><\/a>";
str += "<\/div>";
return str
}
function showSplit(id) {
var splitLayer = loadSplit(id);
allSplitsLayer.addLayer(splitLayer);
}
function josmImportWithMeta(splitId) {
//var josmUri=location.origin + '/data-20140911/raba'+splitId+'diss.osm.zip';
//var josmUri=location.origin + '/RabaSplits_20160731_EPSG4326/raba'+splitId+'dissJosm.zip';
var josmUri= dataBaseUrl + 'raba'+splitId+'dissJosm.zip';
//josmLoadAndZoom(josmUri, "RABA-KGZ", "Importing split " + splitId + " from RABA-KGZ");
//josmLoadAndZoom(0,0,0,0, "RABA-KGZ", "Importing split " + splitId + " from RABA-KGZ");
josmImport(josmUri, "RABA-KGZ", "#RABA-KGZ import split " + splitId);
}
function josmImportWithMetaForest(splitId) {
//var josmUri=location.origin + '/data-20140911/raba'+splitId+'diss.osm.zip';
var josmUri=location.origin + '/RabaSplits_20151231_forest_EPSG4326/rabaForest'+splitId+'dissJosm.zip';
//josmLoadAndZoom(josmUri, "RABA-KGZ", "Importing split " + splitId + " from RABA-KGZ");
//josmLoadAndZoom(0,0,0,0, "RABA-KGZ", "Importing split " + splitId + " from RABA-KGZ");
josmImport(josmUri);
}
function loadGrid() {
// split grid
var myIcon = L.divIcon({className: 'my-div-icon'});
var splitGridShp = new L.Shapefile('grid/newSplitID_improve1_84.zip',{onEachFeature:function(feature, layer) {
if (feature.properties) {
var newSplitID = feature.properties["newSplitID"];
//console.log(newSplitID);
//console.log(feature.properties["newSplitID"] + ': ' + layer.getBounds());
//L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
//L.marker(feature.getLatLng(), {icon: myIcon, html: "foo"}).addTo(map);
//L.marker(layer.getLatLng(), {icon: myIcon}).addTo(map);
//layer.bindPopup("Split " + newSplitID);
layer.bindPopup(buildDialog(newSplitID, layer));
//layer.bindPopup(newSplitID,{maxHeight:200});
//if(splitGridShp) {
// map.fitBounds(splitGridShp.getBounds());
//}
//map.fitBounds(layer.getBounds());
}
else { console.log("no properties?"); }
//}, style:function(feature, layer) { return "";}};
//}});
}, style:function(feature, layer) {
//return "";
//if(feature.properties && $.inArray( feature.properties["newSplitID"], SplitsAvailable ) != -1)
if(feature.properties && feature.properties["newSplitID"]<=3640)
{
return {color: "red", weight:0.5, fill: true, fillOpacity: 0.0};
}
return {color: "magenta", weight:0.5, fill: true, fillOpacity: 0.2};
}, filter:function(feature, layer) {
return true;
/*
if(feature.properties && feature.properties["newSplitID"] < 100 )
{
return true;
}
return false;
*/
}, load:function(layer) {
map.fitBounds(layer.getBounds());
console.log("loaded.");
//return true;
}});
//splitGridShp.addTo(map);
splitGridShp.once("load", function(){
console.log("finished loaded splitGridShp");
});
splitGridShp.on("load", function(){
console.log("2finished loaded splitGridShp");
});
return splitGridShp;
}
function loadSplit(splitId) {
// dissolved split details
var featureStyle = {};
featureStyle["RABA_ID:1100"] = {color: "#B3885D", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["landuse:farmland|source:RABA-KGZ|natural:"] = {color: "brown", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1160"] = {color: "#CCCC00", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1180"] = {color: "#CCFF33", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1190"] = {color: "#66FF99", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1211"] = {color: "#E598F5", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["landuse:vineyard|source:RABA-KGZ|natural:"] = {color: "#ff4444", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1212"] = {color: "#E598F5", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1221"] = {color: "#B5E359", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1222"] = {color: "#ACE359", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1230"] = {color: "#93D61E", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1240"] = {color: "#7DD61E", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1300"] = {color: "#aaffaa", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["landuse:meadow|source:RABA-KGZ|natural:"] = {color: "#aaffaa", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1321"] = {color: "#AAFFC8", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1410"] = {color: "#8BD683", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1420"] = {color: "#5DB553", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1500"] = {color: "#7CD957", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["landuse:|source:RABA-KGZ|natural:scrub"] = {color: "#66ff66", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1600"] = {color: "#90A887", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:1800"] = {color: "#79BF71", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:2000"] = {color: "#229922", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["landuse:forest|source:RABA-KGZ|natural:"] = {color: "#22ff22", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:3000"] = {color: "red", weight:1, opacity:0.5, fill: true, fillOpacity: 0.0};
featureStyle["RABA_ID:4100"] = {color: "#57CFB1", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:4210"] = {color: "#29C28F", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:4220"] = {color: "#57CFB9", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:5000"] = {color: "#D9FFD9", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:6000"] = {color: "#E6E6E6", weight:2, fill: true, fillOpacity: 0.2};
featureStyle["RABA_ID:7000"] = {color: "#4444ff", weight:2, fill: true, fillOpacity: 0.2};
//var shpUrl = 'data-20140911/raba' + splitId + 'diss.zip';
//var shpUrl = 'RabaSplits_20160731_EPSG4326/raba' + splitId + 'dissJosm.zip';
//var shpUrl = dataBaseUrl + 'raba' + splitId + 'dissJosm.zip?cb=' + Math.round(new Date().getTime() / 1000) ;
var shpUrl = dataBaseUrl + 'raba' + splitId + 'dissJosm.zip';
//var shpUrl = 'data/raba' + splitId + 'diss.zip';
console.log("Loading: " + shpUrl);
var shpfile = new L.Shapefile(shpUrl, {attribution:'<a href="https://www.gov.si/drzavni-organi/ministrstva/ministrstvo-za-kmetijstvo-gozdarstvo-in-prehrano/" target="_blank">MKGP</a>', onEachFeature:function(feature, layer) {
if (feature.properties) {
layer.bindPopup(buildDialog(splitId) +"<br>"+Object.keys(feature.properties).map(function(k){
var val=feature.properties[k];
if(val instanceof Date) {
var tzoffset=val.getTimezoneOffset() * 60000; //offset in milliseconds
val=new Date(val-tzoffset).toISOString().slice(0, 10);
}
if(val!="") {
return "<a href=\"https://wiki.openstreetmap.org/wiki/Key:" + encodeURIComponent(k) + "\" target=\"osmwiki\">" + k
+ "</a>=<b><a href=\"https://wiki.openstreetmap.org/wiki/Tag:" + encodeURIComponent(k + "=" + val) + "\" target=\"osmwiki\">" + val +"</a></b><br />";
}
}).join(""),{maxHeight:200});
}
}, style:function(feature, layer) {
//return "";
if(feature.properties)
{
var keys=Object.keys(feature.properties).length;
var featureKey="??"+keys;
if(keys>=1)
{
var origKey=Object.keys(feature.properties)[0];
var mappedKey=origKey;
if(origKey=="raba:id") { mappedKey="RABA_ID"; }
featureKey = mappedKey + ":" + feature.properties[origKey];
}
//var featureKey = Object.keys(feature.properties).map(function(k){
// return k + ":" + feature.properties[k] ;
// }).join("|");
if ( featureStyle[featureKey]==undefined ) {
console.log("Style not found for: " + featureKey);
return {color: "magenta", weight:1, fill: true, fillOpacity: 0.3};
}
return featureStyle[featureKey];
}
return {color: "magenta", weight:1, fill: true, fillOpacity: 0.0};
}});
shpfile.once("load", function(){
console.log("finished loaded shpfile");
});
//shpfile.addAttribution("shp");
return shpfile;
}
//var allSplitsLayer = L.layerGroup();
var allSplitsLayer = L.featureGroup();
// .bindPopup('Hello world!')
// .on('click', function() { alert('Clicked on a group!'); });
var layerControl;
function show() {
// initialize the map on the "map" div with a given center and zoom
var map = L.map('map', {
center: [46.05, 14.5],
zoom: 9,
//maxBounds: [[45.4, 13.3],[46.9, 16.63]],
maxBounds: [[45, 13],[47, 17]],
minZoom: 8,
maxZoom: 25
});
var osm = L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
//var hereLayer = L.tileLayer.provider('HERE.satelliteDay');
var esriLayer = L.tileLayer.provider('Esri.WorldImagery');
var mtbLayer = L.tileLayer.provider('MtbMap');
var watercolor = L.tileLayer.provider('Stamen.Watercolor');
var gursDof025 = L.tileLayer.provider('GursDof025');
var gursDof025Transparent = L.tileLayer.provider('GursDof025');
gursDof025Transparent.setOpacity(0.5);
var freeMapOutdoors = L.tileLayer.provider('freeMapOutdoors');
var rabaLayer = L.tileLayer.provider('Raba');
var rabaLayerTransparent = L.tileLayer.provider('Raba');
rabaLayerTransparent.setOpacity(0.5);
//rabaLayerTransparent.addTo(map);
var raba3000Layer = L.tileLayer.provider('Raba3000');
//raba3000Layer.addTo(map);
var gursBuildingsLayer = L.tileLayer.provider('GursBuildings');
var gursRoadsLayer = L.tileLayer.provider('GursRoads');
var dolinesLayer = L.tileLayer.provider('Dolines');
var DigitalGlobePremiumLayer = L.tileLayer.provider('DigitalGlobe.premium');
var DigitalGlobeStandardLayer = L.tileLayer.provider('DigitalGlobe.standard');
var CopernicusFeatheringLayer = L.tileLayer.provider('Copernicus.feathering');
var CopernicusFeatheringOverlay = L.tileLayer.provider('Copernicus.feathering');
CopernicusFeatheringOverlay.setOpacity(0.5);
var WmfLabsHillshadingOverlay = L.tileLayer.provider('WmfLabs.hillshading');
var osmfrLayer = L.tileLayer.provider('OpenStreetMap.osmfr');
var mapQuestOpenOSMLayer = L.tileLayer.provider('MapQuestOpen.OSM');
//var mapQuestOpenAerialLayer = L.tileLayer.provider('MapQuestOpen.Aerial');
var blankMapLayer = L.tileLayer.provider('BlankMap');
var openSnowMapLayer = L.tileLayer.provider('OpenStreetMap.openSnowMap');
//openSnowMapLayer.addTo(map);
//WmfLabsHillshadingOverlay.addTo(map);
L.control.scale({imperial: false, maxWidth: 200}).addTo(map);
L.control.mousePosition().addTo(map);
//map.attributionControl.addAttribution("<a href=\"https://wiki.openstreetmap.org/wiki/Slovenia_Landcover_Import_-_RABA-KGZ\">RABA overlay<\/a> courtesy of <a href=\"https://www.gov.si/drzavni-organi/ministrstva/ministrstvo-za-kmetijstvo-gozdarstvo-in-prehrano/\">Ministrstvo za kmetijstvo, gozdarstvo in prehrano<\/a>");
map.attributionControl.setPrefix("");
//map.attributionControl.addAttribution("<a href=\"http://www.mkgp.gov.si/\" target=\"_blank\">MKGP<\/a>");
var gridLayer = loadGrid();
gridLayer.addTo(map);
//var allSplitsLayer = L.layerGroup();
$.each(SplitsAvailable, function( index, value ) {
//alert( index + ": " + value );
//var splitLayer = loadSplit(value);
//allSplitsLayer.addLayer(splitLayer)
});
//allSplitsLayer.addAttribution("<a href=\"http://www.mkgp.gov.si/\" target=\"_blank\">MKGP<\/a>");
allSplitsLayer.addTo(map);
//var splitLayer = loadSplit(43);
//splitLayer.addTo(map);
var baseLayers = {
// "Mapbox": mapbox,
"OSM Mapnik": osm,
"RABA": rabaLayer,
//"HERE": hereLayer,
"ESRI satellite": esriLayer,
// "DigitalGlobe Premium": DigitalGlobePremiumLayer,
// "DigitalGlobe Standard": DigitalGlobeStandardLayer,
"Copernicus": CopernicusFeatheringLayer,
"Mountainbike": mtbLayer,
"OpenStreetMap.fr": osmfrLayer,
// "MapQuestOpen": mapQuestOpenOSMLayer,
//"MapQuestOpen Aerial": mapQuestOpenAerialLayer,
"GURS DOF025": gursDof025,
"FreeMap.sk": freeMapOutdoors,
"Watercolor": watercolor,
"Blank :)": blankMapLayer
};
var overlays = {
"Split grid": gridLayer,
"Split detail": allSplitsLayer,
"RABA 3000": raba3000Layer,
"RABA 50%": rabaLayerTransparent,
"GURS buildings": gursBuildingsLayer,
"GURS roads": gursRoadsLayer,
"Dolines": dolinesLayer,
"GURS DOF025": gursDof025Transparent,
// "OpenSnowMap": openSnowMapLayer,
"Copernicus 50%": CopernicusFeatheringOverlay,
"Hillshading": WmfLabsHillshadingOverlay
};
layerControl = L.control.layers(baseLayers, overlays).addTo(map);
var hash = new L.Hash(map);
josmGetVersion();
$("#nav-btn").click(function() {
$(".navbar-collapse").collapse("toggle");
return false;
});
var autocomplete = new kt.OsmNamesAutocomplete(
'srch-term', 'https://geocoder.tilehosting.com/si/', 'dgz5zNlwEk8Oup3sYX1O');
autocomplete.registerCallback(function(item) {
// alert(JSON.stringify(item, ' ', 2));
// console.log(item);
// console.log(item.boundingbox, map);
map.fitBounds([
[item.boundingbox[1], item.boundingbox[0]],
[item.boundingbox[3], item.boundingbox[2]]
], {
maxZoom: 14
});
});
}
function unloadAllSplits(){
allSplitsLayer.clearLayers();
//layerControl.removeLayer(allSplitsLayer)
//allSplitsLayer = L.layerGroup();
//allSplitsLayer.addTo(map);
}
$(window).resize(function() {
sizeLayerControl();
});
$(document).on("click", ".feature-row", function(e) {
$(document).off("mouseout", ".feature-row", clearHighlight);
sidebarClick(parseInt($(this).attr("id"), 10));
});
$(document).on("mouseover", ".feature-row", function(e) {
highlight.clearLayers().addLayer(L.circleMarker([$(this).attr("lat"), $(this).attr("lng")], highlightStyle));
});
$(document).on("mouseout", ".feature-row", clearHighlight);
$("#about-btn").click(function() {
$("#aboutModal").modal("show");
$(".navbar-collapse.in").collapse("hide");
return false;
});
$("#full-extent-btn").click(function() {
map.fitBounds(boroughs.getBounds());
$(".navbar-collapse.in").collapse("hide");
return false;
});
$("#legend-btn").click(function() {
$("#legendModal").modal("show");
$(".navbar-collapse.in").collapse("hide");
return false;
});
$("#login-btn").click(function() {
$("#loginModal").modal("show");
$(".navbar-collapse.in").collapse("hide");
return false;
});
$("#list-btn").click(function() {
$('#sidebar').toggle();
map.invalidateSize();
return false;
});
$("#nav-btn").click(function() {
$(".navbar-collapse").collapse("toggle");
return false;
});
function sizeLayerControl() {
$(".leaflet-control-layers").css("max-height", $("#map").height() - 50);
}
function clearHighlight() {
highlight.clearLayers();
}
// --> ]]>
</script>
</head>
<body onload="show()">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<div class="navbar-icon-container">
<a href="#" class="navbar-icon pull-right visible-xs" id="nav-btn"><i class="fa fa-bars fa-lg white"></i></a>
<!-- <a href="#" class="navbar-icon pull-right visible-xs" id="sidebar-toggle-btn"><i class="fa fa-search fa-lg white"></i></a> -->
</div>
<a class="navbar-brand" href="#">OSM RABA import</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-info-circle"></i> Info<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://wiki.openstreetmap.org/wiki/Slovenia_Landcover_Import_-_RABA-KGZ" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-question-circle"></i> Wiki</a></li>
<li><a href="https://forum.openstreetmap.org/viewtopic.php?id=27289" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-users"></i> Forum</a></li>
<li><a href="https://taginfo.openstreetmap.org/keys/raba%3Aid#values" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-bar-chart"></i> Statistics</a></li>
<li><a href="https://osmstats.neis-one.org/?item=countries&country=Slovenia" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-line-chart"></i> Activity</a></li>
<li><a href="https://resultmaps.neis-one.org/osm-changesets?comment=RABA-KGZ" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-pencil-square-o"></i> Changesets</a></li>
</ul>
</li>
<li><a href="javascript:unloadAllSplits()" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-trash"></i> Unload all</a></li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">JOSM<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="javascript:josmGetVersion()" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-pencil-square"></i> Remote: <span id="josmRemoteInfo">None</span></a><!-- - <a href="http://josm.openstreetmap.de/wiki/Help/Preferences/RemoteControl">help</a> --></li>
<li><a href="javascript:josmImagery('Raba 3000', 'tms', 'https://wms.openstreetmap.de/tms/RABA3000/{zoom}/{x}/{y}.png')" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-caret-square-o-down"></i> Add underlay 3000</a></li>
<li><a href="javascript:josmImagery('Raba', 'tms', 'https://wms.openstreetmap.de/tms/RABA/{zoom}/{x}/{y}.png')" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-caret-square-o-down"></i> Add underlay</a></li>
<li><a href="javascript:josmImagery('Raba grid', 'tms', 'https://wms.openstreetmap.de/tms/RABAsplits/{zoom}/{x}/{y}.png')" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-caret-square-o-down"></i> Add grid underlay</a></li>
</ul>
</li>
<!--li><a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="about-btn"><i class="fa fa-question-circle white"></i> About</a></li-->
<!--li class="dropdown">
<a id="toolsDrop" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe white"></i> Tools <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="full-extent-btn"><i class="fa fa-arrows-alt"></i> Zoom To Full Extent</a></li>
<li><a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="legend-btn"><i class="fa fa-picture-o"></i> Show Legend</a></li>
<li class="divider hidden-xs"></li>
<li><a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="login-btn"><i class="fa fa-user"></i> Login</a></li>
</ul>
</li-->
<!--li class="dropdown">
<a class="dropdown-toggle" id="downloadDrop" href="#" role="button" data-toggle="dropdown"><i class="fa fa-cloud-download white"></i> Download <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="data/boroughs.geojson" download="boroughs.geojson" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-download"></i> Boroughs</a></li>
<li><a href="data/subways.geojson" download="subways.geojson" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-download"></i> Subway Lines</a></li>
<li><a href="data/DOITT_THEATER_01_13SEPT2010.geojson" download="theaters.geojson" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-download"></i> Theaters</a></li>
<li><a href="data/DOITT_MUSEUM_01_13SEPT2010.geojson" download="museums.geojson" target="_blank" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-download"></i> Museums</a></li>
</ul>
</li-->
<!--li class="hidden-xs"><a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="list-btn"><i class="fa fa-list white"></i> POI List</a></li-->
</ul>
<!--form class="navbar-form navbar-right" role="search">
<div class="form-group has-feedback">
<input id="searchbox" type="text" placeholder="Search" class="form-control">
<span id="searchicon" class="fa fa-search form-control-feedback"></span>
</div>
</form-->
<div class="col-sm-3 col-md-3 pull-right">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term" autocomplete="off">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div><!--/.navbar-collapse -->
</div>
</div>
<div id="container">
<!--div class="leaflet-bar leaflet-container" style="position:fixed;left:30%;right:30%;top:-8px;z-index:1000;background:white;text-align:center;padding-top:8px;font-weight:bold">
<h1>RABA import overview</h1>
</div-->
<!-- <div id="sidebar">
<div class="sidebar-wrapper">
<div class="panel panel-default" id="features">
<div class="panel-heading">
<h3 class="panel-title">Points of Interest
<button type="button" class="btn btn-xs btn-default pull-right" id="sidebar-hide-btn"><i class="fa fa-chevron-left"></i></button></h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-8 col-md-8">
<input type="text" class="form-control search" placeholder="Filter" />
</div>
<div class="col-xs-4 col-md-4">
<button type="button" class="btn btn-primary pull-right sort" data-sort="feature-name" id="sort-btn"><i class="fa fa-sort"></i> Sort</button>
</div>
</div>
</div>
<div class="sidebar-table">
<table class="table table-hover" id="feature-list">
<thead class="hidden">
<tr>
<th>Icon</th>
<tr>
<tr>
<th>Name</th>
<tr>
<tr>
<th>Chevron</th>
<tr>
</thead>
<tbody class="list"></tbody>
</table>
</div>
</div>
</div>
</div> -->
<div id="map"></div>
</div>
</body>
</html>