forked from tmkasun/geo_dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.jag
1005 lines (893 loc) · 50.8 KB
/
map.jag
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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<% (function (){ %>
<%
if(!session.get("user")){
session.put("error", "Please login using tenant details before using map");
try{
response.sendRedirect("/geo_dashboard/new/");
return;
} catch(error){
return;
}
}
var user = session.get("user");
%>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="description" content="">
<meta name="author" content="">
<title>WSO2 Geo Dashboard</title>
<link rel="apple-touch-icon" sizes="76x76" href="assets/img/favicon-76.png">
<link rel="apple-touch-icon" sizes="120x120" href="assets/img/favicon-120.png">
<link rel="apple-touch-icon" sizes="152x152" href="assets/img/favicon-152.png">
<link rel="icon" sizes="196x196" href="assets/img/favicon-196.png">
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico">
<link rel="stylesheet" href="assets/css/app.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<!-- Leaflet styles -->
<link rel="stylesheet" href="assets/css/leaflet.css"/>
<link rel="stylesheet" href="assets/css/L.Control.Locate.css"/>
<link rel="stylesheet" href="assets/css/MarkerCluster.Default.css"/>
<link rel="stylesheet" href="assets/css/leaflet_fullscreen/leaflet.fullscreen.css"/>
<link rel="stylesheet" href="assets/css/leaflet/leaflet.draw.css"/>
<link rel="stylesheet" href="assets/css/uikit/uikit.min.css"/>
<link rel="stylesheet" href="assets/css/uikit/addons/uikit.addons.min.css"/>
<link rel="stylesheet" href="assets/css/jquery-ui.min.css">
<link rel="stylesheet" href="assets/css/jquery-ui.theme.min.css">
<!--bootstrap-application-wizard-->
<link rel="stylesheet" href="assets/css/bootstrap-wizard-lib/bootstrap-wizard.css">
<!--TODO: use http://requirejs.org/ for better performance, now we have too many imports -->
<!-- C3 chart library styles-->
<link rel="stylesheet" href="assets/css/d3/c3.css">
<script src="assets/js/jquery-2.1.1.min.js"></script>
<script src="assets/js/jquery-ui.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!--bootstrap-application-wizard-->
<script src="assets/js/bootstrap-wizard-lib/bootstrap-wizard.js"></script>
<!-- Leaflet plugins libries -->
<script src="assets/js/leaflet/leaflet.js"></script>
<script src="assets/js/leaflet/leaflet.markercluster.js"></script>
<script src="assets/js/leaflet/L.Control.Locate.js"></script>
<script src="assets/js/leaflet/leaflet.groupedlayercontrol.js"></script>
<script src="assets/js/leaflet/Leaflet.fullscreen.min.js"></script>
<script src="assets/js/leaflet/Marker.Rotate.js"></script>
<script src="assets/js/leaflet/leaflet.draw.js"></script>
<!-- TODO: for reference <Update lib or remove if not in use>: This `R`(RaphaelLayer: https://github.com/dynmeth/RaphaelLayer) library is dam buggy can't use it reliably -->
<!--<script src="assets/js/leaflet/rlayer.js"></script>-->
<!--<script src="assets/js/leaflet/raphael-min.js"></script>-->
<script src="assets/js/typeahead.bundle.min.js"></script>
<!-- C3 charting library using D3 core -->
<script src="assets/js/d3/d3.min.js"></script>
<script src="assets/js/d3/c3.min.js"></script>
<!-- UIkit libraries -->
<script src="assets/js/uikit/uikit.min.js"></script>
<script src="assets/js/uikit/addons/notify.min.js"></script>
<!-- Self javascript libraries (Order of the import is very important, changing the order might shadow some variables, append new script to bottom ) -->
<!-- ** comment out below imports if using minimized wso2_geo.min library ** -->
<script src="assets/js/application_options.js"></script>
<script>
var webSocketURL = 'ws://'+ApplicationOptions.constance.WEB_SOCKET_SERVER+':'+ApplicationOptions.constance.WEB_SOCKET_PORT+'/outputwebsocket/t/' + '<%= user.domain %>' + '/'+ApplicationOptions.constance.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME+'/'+ApplicationOptions.constance.CEP_WEB_SOCKET_BUILDER_TOPIC; // TODO: Get the server IP and port and other static information from the applicationOptions object
console.log(webSocketURL);
ApplicationOptions.constance.WEB_SOCKET_URL = webSocketURL;
</script>
<script src="assets/js/websocket.js"></script>
<script src="assets/js/geo_remote.js"></script>
<script src="assets/js/geo_fencing.js"></script>
<script src="assets/js/show_alert_in_map.js"></script>
<!-- Combined and compiled JS with google closure compile-->
<!--<script src="assets/js/wso2_geo/wso2_geo.min.js"></script>-->
<style>
/*
TODO: Move this styles to separate CSS for clarity.
*/
.navbar {
background-color: rgba(54, 51, 45, 0.7);
background: rgba(54, 51, 45, 0.7);
color: rgba(0, 0, 0, 0.8);
border-radius: 0px 0px 0px 0px;
-webkit-box-shadow: 0px 16px 29px -17px rgba(33, 20, 4, 1);
-moz-box-shadow: 0px 16px 29px -17px rgba(33, 20, 4, 1);
box-shadow: 0px 16px 29px -17px rgba(33, 20, 4, 1);
border: none;
margin: auto;
z-index: 1000;
}
#mapSearch {
border: 0;
}
#container {
position: fixed;
top: 0px;
}
.leaflet-top {
/*To prevent cutting off the top element by header bar in dashboard*/
top: 50px;
}
.leaflet-right {
/* to prevent showing layers controller over objectInfor side pane */
z-index: 0;
}
.leaflet-popup-content {
width: 200px;
margin: 6px;
}
#objectInfoCloseButton:hover {
cursor: pointer;
color: firebrick;
}
.sectionJointStyle {
stroke-dasharray: 3, 20;
}
</style>
<script>
// TODO: move this js code to proper place most probably app.js
var setupWizard;
// wizard with it's cards initialization.
$(function () {
var options = {submitUrl: "controllers/setup_dashboard.jag"};
setupWizard = $("#setup_dashboard").wizard(options);
});
</script>
</head>
<body style="margin: 0;padding: 0;">
<div id="container">
<!-- Sidebar -->
<div id="map"></div>
</div>
<nav class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<div class="navbar-icon-container">
<a href="#left_side_pannel" data-uk-offcanvas class="navbar-icon pull-right visible-xs"
><i class="fa fa-bars fa-lg" style="color: #FF9900"></i></a>
<a href="#" class="navbar-icon pull-right visible-xs"
onclick="$('.navbar-collapse').collapse('toggle');return false;"><i class="fa fa-search fa-lg"
style="color: #FF9900"></i></a>
</div>
<a class="navbar-brand" href="#"><img style="max-width:100px; margin-top: -7px;"
src="assets/img/wso2-logo.png"/></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="hidden-xs"><a href="#left_side_pannel" data-uk-offcanvas>
<i class="fa fa-list" style="color: #FF9900"></i></a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<form id="mapSearch" class="navbar-form" role="search"
onsubmit="focusOnSpatialObject($(this).find('#searchbox').val());return false;">
<div class="form-group has-feedback">
<input autofocus="true" id="searchbox" type="text" placeholder="Search"
class="form-control typeahead">
<span id="searchicon" class="fa fa-search form-control-feedback"></span>
</div>
<input style="visibility: hidden; position: fixed;" type="submit"/>
</form>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span style="color: #f9fdff;">Signed-in as: <%= user.username + "@" + user.domain %></span></a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#" data-toggle="collapse" data-target=".navbar-collapse.in"
onclick="$('#aboutModal').modal('show'); return false;">About</a>
</li>
<li><a href="#">Doc</a></li>
<li class="divider"></li>
<li><a href="controllers/logout.jag">Logout</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div id="objectInfo" style="background: darkgray;display: none;border-radius: 13px;height: 94%;padding: 0"
class="col-md-2 pull-right">
<div class="panel-heading text-center">
<h4> Spatial Object ID: <span id="objectInfoId" class="text-info"></span>
<i id="objectInfoCloseButton" class="fa fa-times pull-right"
onclick="$('#objectInfo').animate({width: ['toggle','swing']},200);toggled = false;spatialObject = currentSpatialObjects[selectedSpatialObject];spatialObject.removePath();spatialObject.marker.closePopup();selectedSpatialObject = null;">
</i>
</h4>
</div>
<div class="panel panel-default" style="max-height: 47%;overflow: auto;box-shadow: 0 0 8px 0 #635749">
<div class="panel-heading text-center"><h4>Speed variation</h4>
</div>
<div class="panel-body">
<!-- TODO: setting `margin-left` to increase the area of the chart is a bad hack there should be a better way to do this check :P -->
<div style="margin: 0;border: none;margin-left: -25px" id="chart_div"></div>
</div>
</div>
<div class="panel panel-default" style="max-height: 47%;overflow: auto;box-shadow: 0px 0px 8px 0px #635749">
<div class="panel-heading text-center">
<div class="panel-title"><h4>Alerts</h4></div>
</div>
<div class="panel-body" style="padding: 0px">
<div id="showAlertsArea" class="list-group" style="margin-top: 15px">
</div>
</div>
</div>
<!--/panel-->
</div>
<div id="left_side_pannel" class="uk-offcanvas" style="z-index: -1;">
<div class="uk-offcanvas-bar" style="box-shadow: 3px 14px 13px -2px #211404;">
<ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav>
<li class="uk-parent" style="box-shadow: 0 2px 12px 1px #2D1600;min-height: 50px;line-height: 25px;">
<a href="#" style="min-height: 50px;">
<span style="color: #d58512">WSO<sub style="font-size: medium;">2</sub></span> Geo Dashboard
</a>
<ul class="uk-nav-sub">
<li style="color: #969490">
Founded in August 2005, WSO2 is a global enterprise middleware corporation with offices in
USA, UK and Sri Lanka.Providing the only complete<a style="color: #007171"
href="http://www.wso2.com">open
source</a> middleware platform, WSO2 is revolutionizing the industry by putting traditional
middleware on a diet and introducing lean, powerful and flexible solutions to address the
21st century enterprise challenges.
</li>
</ul>
</li>
<li class="uk-nav-header">Alerts</li>
<li class="uk-parent">
<a href="#"><i class="fa fa-pencil-square-o"></i> Set alerts</a>
<ul class="uk-nav-sub">
<!-- Set speed limit -->
<li>
<a style="margin-left: 20%;" data-toggle="modal" href="controllers/modals/speed_alert.jag"
data-target="#commonModal"><i
class="fa fa-tachometer"></i> Speed alert</a>
</li>
<li><a style="margin-left: 20%;" data-toggle="modal" href="controllers/modals/proximity_alert.jag"
data-target="#commonModal"><i class="fa fa-link"></i> Proximity alert</a></li>
<li><a style="margin-left: 20%;" data-toggle="modal" href="controllers/modals/stationery_alert.jag" data-target="#commonModal">
<i class="fa fa-chain-broken"></i> Stationary alert</a></li>
</ul>
</li>
<!-- Set Geo-fence -->
<li class="uk-parent">
<a href="#"><i class="fa fa-filter"></i> Geo-fencing</a>
<ul class="uk-nav-sub">
<li><a style="margin-left: 20%;" data-toggle="modal" href="controllers/modals/within_alert.jag"
data-target="#commonModal"><i class="fa fa-square-o"></i> Within</a></li>
<li><a style="margin-left: 20%;color: grey;cursor: not-allowed;"><i
class="fa fa-external-link-square"></i> Approaching</a></li>
<li><a style="margin-left: 20%;color: grey;cursor: not-allowed;"><i class="fa fa-minus"></i>
Cross</a></li>
</ul>
</li>
<!-- Settings section -->
<li class="uk-nav-header">Settings</li>
<!-- Add new tile server url -->
<li>
<a data-toggle="modal" data-target="#addTileServer"><i class="fa fa-plus"></i> Add tile server</a>
</li>
<!-- Add new WMS server url -->
<li>
<a data-toggle="modal" data-target="#addWmsUrl"><i class="fa fa-globe"></i> Add WMS end point</a>
</li>
<!-- Place holders need to remove or replace-->
<li class="uk-nav-header">
System Administrtion
</li>
<li>
<a onclick="setupWizard.show();return false;"><i style="color: #ff8905;" class="fa fa-cogs"></i> Setup
Dashboard</a>
</li>
</ul>
</div>
</div>
<div id="loading">
<div class="loading-indicator">
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-info" style="width: 100%"></div>
</div>
</div>
</div>
<!-- Modals in use -->
<div class="modal" id="aboutModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Welcome to the BootLeaf template!</h4>
</div>
<div class="modal-body">
<ul class="nav nav-tabs" id="aboutTabs">
<li class="active"><a href="#about" data-toggle="tab"><i class="fa fa-question-circle"></i> About
the project</a></li>
<li><a href="#contact" data-toggle="tab"><i class="fa fa-envelope"></i> Contact us</a></li>
<li><a href="#disclaimer" data-toggle="tab"><i class="fa fa-exclamation-circle"></i> Disclaimer</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe"></i> Metadata
<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#boroughs-tab" data-toggle="tab">Boroughs</a></li>
<li><a href="#subway-lines-tab" data-toggle="tab">Subway Lines</a></li>
<li><a href="#theaters-tab" data-toggle="tab">Theaters</a></li>
<li><a href="#museums-tab" data-toggle="tab">Museums</a></li>
</ul>
</li>
</ul>
<div class="tab-content" id="aboutTabsContent" style="padding-top: 10px;">
<div class="tab-pane fade active in" id="about">
<p>A simple, responsive template for building web mapping applications with <a
href="http://getbootstrap.com/">Bootstrap 3</a>, <a href="http://leafletjs.com/"
target="_blank">Leaflet</a>, and <a
href="http://twitter.github.io/typeahead.js/" target="_blank">typeahead.js</a>. Open
source, MIT licensed, and available on <a href="https://github.com/bmcbride/bootleaf"
target="_blank">GitHub</a>.</p>
<div class="panel panel-primary">
<div class="panel-heading">Features</div>
<ul class="list-group">
<li class="list-group-item">Fullscreen mobile-friendly map template with responsive
navbar and modal placeholders
</li>
<li class="list-group-item">jQuery loading of external GeoJSON files</li>
<li class="list-group-item">Logical multiple layer marker clustering via the <a
href="https://github.com/Leaflet/Leaflet.markercluster" target="_blank">leaflet
marker cluster plugin</a></li>
<li class="list-group-item">Elegant client-side multi-layer feature search with
autocomplete using <a href="http://twitter.github.io/typeahead.js/" target="_blank">typeahead.js</a>
</li>
<li class="list-group-item">Responsive sidebar feature list with sorting and filtering
via <a href="http://listjs.com/" target="_blank">list.js</a></li>
<li class="list-group-item">Marker icons included in grouped layer control via the <a
href="https://github.com/ismyrnow/Leaflet.groupedlayercontrol" target="_blank">grouped
layer control plugin</a></li>
</ul>
</div>
</div>
<div id="disclaimer" class="tab-pane fade text-danger">
<p>The data provided on this site is for informational and planning purposes only.</p>
<p>Absolutely no accuracy or completeness guarantee is implied or intended. All information on
this map is subject to such variations and corrections as might result from a complete title
search and/or accurate field survey.</p>
</div>
<div class="tab-pane fade" id="contact">
<form id="contact-form">
<div class="well well-sm">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="first-name">First Name:</label>
<input type="text" class="form-control" id="first-name">
</div>
<div class="form-group">
<label for="last-email">Last Name:</label>
<input type="text" class="form-control" id="last-email">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="text" class="form-control" id="email">
</div>
</div>
<div class="col-md-8">
<label for="message">Message:</label>
<textarea class="form-control" rows="8" id="message"></textarea>
</div>
<div class="col-md-12">
<p>
<button type="submit" class="btn btn-primary pull-right"
data-dismiss="modal">Submit
</button>
</p>
</div>
</div>
</div>
</form>
</div>
<div class="tab-pane fade" id="boroughs-tab">
<p>Borough data courtesy of <a
href="http://www.nyc.gov/html/dcp/html/bytes/meta_dis_nyboroughwi.shtml"
target="_blank">New York City Department of City Planning</a></p>
</div>
<div class="tab-pane fade" id="subway-lines-tab">
<p><a href="http://spatialityblog.com/2010/07/08/mta-gis-data-update/#datalinks"
target="_blank">MTA Subway data</a> courtesy of the <a
href="http://www.urbanresearch.org/about/cur-components/cuny-mapping-service"
target="_blank">CUNY Mapping Service at the Center for Urban Research</a></p>
</div>
<div class="tab-pane fade" id="theaters-tab">
<p>Theater data courtesy of <a
href="https://data.cityofnewyork.us/Recreation/Theaters/kdu2-865w" target="_blank">NYC
Department of Information & Telecommunications (DoITT)</a></p>
</div>
<div class="tab-pane fade" id="museums-tab">
<p>Museum data courtesy of <a
href="https://data.cityofnewyork.us/Recreation/Museums-and-Galleries/sat5-adpb"
target="_blank">NYC Department of Information & Telecommunications (DoITT)</a></p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<div class="modal" id="attributionModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">
WSO2 Geo Dashboard
</h4>
</div>
<div class="modal-body">
<div id="attribution"></div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- Add tile server input modal -->
<div class="modal" id="addTileServer" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header"
style="cursor: move;background: #f9f9f9;-webkit-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);-moz-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">
<!-- TODO: Trigger bootstrap tooltip $('#aboutTileUrl').tooltip(); to enable tooltip -->
Add tiler server URL <sup id="aboutTileUrl" style="cursor: pointer;" data-toggle="tooltip"
title="What is a tile URL?"><i class="fa fa-question" style="color: #39F;"
data-toggle="collapse"
data-target="#collapseOne"></i></sup>
</h4>
</div>
<div class="modal-body">
<div id="urlInput">
<div style="height: 0px;" id="collapseOne" class="panel-collapse collapse">
<div class="panel-body">
<p>A string of the following form:</p>
<pre><code class="javascript"><span class="string">'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'</span></code></pre>
<p><code class="javascript">{s}</code> means one of the available subdomains (used
sequentially to help with browser parallel requests per domain limitation; subdomain
values are specified in options; <code class="javascript">a</code>, <code
class="javascript">b</code> or <code class="javascript">c</code> by default, can
be omitted), <code class="javascript">{z}</code> — zoom level, <code class="javascript">{x}</code>
and <code class="javascript">{y}</code> — tile coordinates.</p>
<p>You can use custom keys in the template, which will be <a
href="#util-template">evaluated</a> from TileLayer options, like this:</p>
<pre><code class="javascript">L.tileLayer(<span class="string">'http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png'</span>,
{foo: <span class="string">'bar'</span>});</code></pre>
</div>
</div>
<div class="input-group input-group-sm">
<span class="input-group-addon"><i class="fa fa-italic"></i></span>
<input autofocus="enable" id="tileName" type="text" class="form-control"
placeholder="Tile URL name">
</div>
<br>
<div class="input-group input-group-sm">
<span class="input-group-addon"><i class="fa fa-globe"></i></span>
<input id="tileUrl" class="form-control" type="text"
placeholder="http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png">
<span class="input-group-btn">
<button class="btn btn-info" type="button" onclick="addTileUrl()"><i class="fa fa-plus"></i>
</button>
</span>
</div>
<!-- TODO: If need show a preview of the map befor add it to backend -->
<!--<h3> TODO: ask subdomains if any, and maxZoom + Attributions </h3>-->
<br/>
<div class="panel panel-default" style="width: 80%;">
<div>
<h4 class="panel-title" style="font-size: 12px;line-height: 1.5;">
<button style="text-align: left;" class="btn btn-default btn-xs btn-block collapsed"
onclick="$('.fa-chevron-right').toggleClass('fa-rotate-90')"
data-toggle="collapse" data-parent="#accordion" href="#tileUrlOptions">
<i class="fa fa-chevron-right"></i> Options
</button>
</h4>
</div>
<div style="height: 0px;" id="tileUrlOptions" class="panel-collapse collapse">
<div class="panel-body">
<div class="input-group input-group-sm col-sm-9">
<small class="text-primary">
<label class="col-sm-2 control-label" for="sub_domains">Sub-domains</label>
</small>
<input id="sub_domains" type="text" class="form-control"
placeholder="Enter sub-domains in CSV format">
</div>
<br/>
<div class="input-group input-group-sm col-sm-9">
<small class="text-primary">
<label class="col-sm-9 control-label" for="maxzoom">Max zoom level</label>
</small>
<input id="maxzoom" type="text" class="form-control"
placeholder="Number between(around) 1~19">
</div>
<br/>
<div class="input-group input-group-sm col-sm-9">
<small class="text-primary">
<label class="col-sm-2 control-label" for="data_attribution">Attribution</label>
</small>
<input id="data_attribution" type="text" class="form-control"
placeholder="Enter attribution">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /Modals in use -->
<!-- Add WMS URL modal -->
<div class="modal" id="addWmsUrl" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header"
style="cursor: move;background: #f9f9f9;-webkit-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);-moz-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">
<!-- TODO: Trigger bootstrap tooltip $('#aboutTileUrl').tooltip(); to enable tooltip -->
Add WMS service end-point<sup id="aboutWms" style="cursor: pointer;" data-toggle="tooltip"
title="What WMS end-point"><i class="fa fa-question"
style="color: #39F;"
data-toggle="collapse"
data-target="#wmsOverview"></i></sup>
</h4>
</div>
<div class="modal-body">
<div>
<div style="height: 0px;" id="wmsOverview" class="panel-collapse collapse">
<div class="panel-body">
The OpenGIS® Web Map Service Interface Standard (WMS) provides a simple HTTP interface for
requesting geo-registered map images from one or more distributed geospatial databases.
A WMS request defines the geographic layer(s) and area of interest to be processed.
The response to the request is one or more geo-registered map images (returned as JPEG, PNG,
etc) that can be displayed in a browser application.
The interface also supports the ability to specify whether the returned images should be
transparent so that layers from multiple servers can be combined or not.
</div>
</div>
<div class="input-group input-group-sm">
<span class="input-group-addon"><i class="fa fa-italic"></i></span>
<input autofocus="enable" id="serviceName" type="text" class="form-control"
placeholder="Service provider name">
</div>
<br>
<div class="input-group input-group-sm">
<span class="input-group-addon"><i class="fa fa-align-justify"></i></span>
<input autofocus="enable" id="layers" type="text" class="form-control"
placeholder="Service layers as comma seperated values">
</div>
<br>
<div class="input-group input-group-sm">
<span class="input-group-addon">V.</span>
<input autofocus="enable" id="wmsVersion" type="text" class="form-control"
placeholder="WMS version (i.e: 1.1.1 or 1.3.0)">
</div>
<br>
<div class="input-group input-group-sm">
<span class="input-group-addon"><i class="fa fa-globe"></i></span>
<input id="serviceEndPoint" class="form-control" type="text"
placeholder="http(s)://sedac.ciesin.columbia.edu/geoserver/wms">
<span class="input-group-btn">
<button class="btn btn-info" type="button" onclick="addWmsEndPoint()"><i
class="fa fa-plus"></i>
</button>
</span>
</div>
<br/>
<div class="panel panel-default" style="width: 80%;">
<div>
<h4 class="panel-title" style="font-size: 12px;line-height: 1.5;">
<button style="text-align: left;" class="btn btn-default btn-xs btn-block collapsed"
onclick="$('.fa-chevron-right').toggleClass('fa-rotate-90')"
data-toggle="collapse" data-parent="#accordion" href="#wmsOptions">
<i class="fa fa-chevron-right"></i> Options
</button>
</h4>
</div>
<div style="height: 0px;" id="wmsOptions" class="panel-collapse collapse">
<div class="panel-body">
<div class="input-group input-group-sm col-sm-11">
<small class="text-primary">
<label class="col-sm-6 control-label" for="outputFormat">Output format</label>
</small>
<input id="outputFormat" type="text" class="form-control"
placeholder="Output format (i.e: image/png, image/jpeg, image/svg)">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /Modals in use -->
<!-- General modal placeholder , TODO: open all the modal through this wrapper via remote AJAX calls -->
<div class="modal" id="commonModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<!-- This content is load by $.ajax call , pages are located at '/controllers/modals/' -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /Modals in use -->
<!-- Import within-GeoJson modal -->
<div class="modal" id="editWithinGeoJSON" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header"
style="cursor: move;background: #f9f9f9;-webkit-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);-moz-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">
<!-- TODO: Trigger bootstrap tooltip $('#aboutTileUrl').tooltip(); to enable tooltip -->
Edit GeoJson object of the selected area
</h4>
</div>
<div class="modal-body">
<div class="form-group">
<div class="form-group">
<label class="text-primary" for="importGeoJsonFile">Import GeoJson</label>
<input id="importGeoJsonFile" type="file">
<hr/>
<label class="text-primary" for="enterGeoJson">Enter GeoJson</label>
<textarea id="enterGeoJson" class="form-control" rows="10"></textarea>
</div>
</div>
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button id="updateGeoJson" class="btn btn-primary" onclick="importGeoJson()">Import</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default" onclick="closeAll()">Cancel</button>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /Modals in use -->
<!-- ** comment out below library if using minimized wso2_geo_app.min library ** -->
<script src="assets/js/app.js"></script>
<!-- Combined and compiled JS with google closure compile-->
<!--<script src="assets/js/wso2_geo/wso2_geo_app.min.js"></script>-->
<!-- Template HTML components used by JS to inject contents-->
<div style="display: none">
<div id="markerPopup" class="popover top">
<div class="arrow"></div>
<h3 class="popover-title">ID <span id="objectId"></span></h3>
<div class="popover-content">
<h6>Information</h6>
<p id="information" class="bg-primary" style="margin: 0px;padding: 0px;"></p>
<h6>Speed<span class="label label-primary pull-right"><span id="speed"></span> km/h</span></h6>
<h6>Heading<span id="heading" class="label label-primary pull-right"></span></h6>
<button type="button" class="btn btn-info btn-xs">History</button>
</div>
</div>
<div id="setWithinAlert">
<form role="form" style="width: auto;">
<div class="form-group">
<label class="text-primary" for="queryName">Query name</label>
<input class="form-control" id="queryName" placeholder="Query name" type="text">
<span class="help-block">Can use this name to locate the execution plan</span>
<label class="text-primary" for="areaName">Fence name</label>
<input class="form-control" id="areaName" placeholder="Fence name" type="text">
<span class="help-block">Name of the selected area(i.e colombo)</span>
</div>
<div>
<div class="btn-group btn-group-sm btn-group-justified">
<div class="btn-group">
<button id="addWithinAlert" onclick="setWithinAlert($(this).attr('leaflet_id'))" type="button"
class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left"
title="Save selected area for alerts">Save
</button>
</div>
<div class="btn-group">
<button id="editGeoJson"
onclick="$('#editWithinGeoJSON #updateGeoJson').attr('leaflet_id',$(this).attr('leaflet_id'));$('#editWithinGeoJSON textarea').text(JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'));$('#editWithinGeoJSON').modal('toggle')"
type="button" class="btn btn-default btn-xs">Edit
</button>
</div>
<div class="btn-group">
<a id="exportGeoJson" download="geoJson.json" href="#"
onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"
class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left"
title="Export selected area as a geoJson file">Export</a>
</div>
</div>
</div>
</form>
</div>
<div id="templateLoader"></div>
<div id="setStationeryAlert">
<form role="form" style="width: auto;">
<div class="form-group">
<label class="text-primary" for="queryName">Query name</label>
<input class="form-control" id="queryName" placeholder="Query name" type="text">
<span class="help-block">Can use this name to locate the execution plan</span>
<label class="text-primary" for="areaName">Fence name</label>
<input class="form-control" id="areaName" placeholder="Stationery name" type="text">
<span class="help-block">Name of the selected area(i.e colombo)</span>
<label class="text-primary" for="time">Time</label>
<input class="form-control" id="time" placeholder="Seconds" type="text">
</div>
<div>
<div class="btn-group btn-group-sm btn-group-justified">
<div class="btn-group">
<button id="addStationeryAlert" onclick="setStationeryAlert($(this).attr('leaflet_id'))" type="button"
class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left"
title="Save selected area for alerts">Save
</button>
</div>
<div class="btn-group">
<button id="editGeoJson"
onclick="$('#editWithinGeoJSON #updateGeoJson').attr('leaflet_id',$(this).attr('leaflet_id'));$('#editWithinGeoJSON textarea').text(JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'));$('#editWithinGeoJSON').modal('toggle')"
type="button" class="btn btn-default btn-xs">Edit
</button>
</div>
<div class="btn-group">
<a id="exportGeoJson" download="geoJson.json" href="#"
onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"
class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left"
title="Export selected area as a geoJson file">Export</a>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- markup for setup dashboard wizard content -->
<!-- TODO: use modular component loading via JQuery, same code has been used in map.jag as well -->
<div class="wizard" id="setup_dashboard" data-title="Setup Geo-Dashboard">
<h1><i class="fa fa-cogs"></i> Setup Geo-Dashboard</h1>
<div class="wizard-card" data-cardname="about">
<h3>About</h3>
<div style="word-wrap: break-word">
<p class="text-info">
This wizard will guide you to configure and setup Wso2 complex event processor and database systems to work with geo-dashboard.
</p>
</div>
</div>
<div class="wizard-card" data-cardname="CEP info">
<h3><sup style="color: red;">*</sup>CEP info</h3>
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="cep-ip" class="col-sm-2 control-label">IP address:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="cep-ip" id="cep-ip" placeholder="localhost">
</div>
</div>
<div class="form-group">
<label for="cep-port" class="col-sm-2 control-label">port:</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="cep-port" id="cep-port" placeholder="9443">
</div>
</div>
<hr/>
<p class="text-muted" style="font-size: small;">
<sup style="color: red;">*</sup> Require > CEP 4.0 or CEP with websocket output adapter component.
</p>
</form>
</div>
<div class="wizard-card" data-cardname="Mysql conf">
<h3>Mysql conf</h3>
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="mysql-ip" class="col-sm-2 control-label">Server:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="mysql-ip" id="mysql-ip" placeholder="localhost">
</div>
</div>
<div class="form-group">
<label for="mysql-user" class="col-sm-2 control-label">Username:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="mysql-user" id="mysql-user" placeholder="root">
</div>
</div>
<div class="form-group">
<label for="mysql-pass" class="col-sm-2 control-label">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="mysql-pass" id="mysql-pass"
placeholder="root">
</div>
</div>
<div class="form-group">
<label for="mysql-db" class="col-sm-2 control-label">DB Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="mysql-db" id="mysql-db" placeholder="wso2_geo">
</div>
</div>
<hr/>
<p class="text-muted"><a href="conf/setup_dashboard/mysql-config/mysql-config.zip">Download</a> MySql
Configuration and run <b>geo_db_setup.sh</b> with <i>sudo</i> privilages.(Get <a target="_blank"
href="http://dev.mysql.com/downloads/connector/j/">JDBC
Driver</a> if required.)</p>
</form>
</div>
<div class="wizard-card" data-cardname="CEP queries">
<h3>CEP queries</h3>
<div style="word-wrap: break-word">
<p>
<a href="conf/setup_dashboard/cep-config/config-xmls.zip">Download</a> CEP configuration files
(<span
class="text-muted">eventbuilders,eventformatters,executionplans,inputeventadaptors,outputeventadaptors</span>)
and
copy into <br/><b><i>{path_to_cep}/repository/deployment/server/</i></b> directory.
</p>
</div>
<hr/>
<div style="word-wrap: break-word">
<p>
<a href="conf/setup_dashboard/cep-config/streamdefinitions.zip">Download</a> CEP stream definitions
and
append to <br/><b><i>{path_to_cep}/repository/conf/data-bridge/stream-definitions.xml</i></b> file.
</p>
</div>
</div>
<div class="wizard-card" data-cardname="CEP Ext's">
<h3>CEP Extensions</h3>
<div style="word-wrap: break-word">
<p>
<a href="https://github.com/wso2-gpl/siddhi/tree/master/siddhi-extensions/geo">Get (Clone)</a> a
copy of siddhi geo extensions from github and build the necessary extensions and put <i>.jar(s)</i>>
into
<br/><b><i>{path_to_cep}/repository/components/lib/</i></b> directory.
</p>
</div>
<hr/>
<div style="word-wrap: break-word">
<p>
Add the following fully-qualified class name(s) to
<br/><b><i>{path_to_cep}/repository/conf/siddhi/siddhi.extension</i></b> file.<br/>
<code>
org.wso2.cep.geo.notify.NotifyAlert <br/>
org.wso2.cep.geo.functions.EventIdGenerator <br/>
org.wso2.cep.geo.libs.FuseEvents <br/>
org.wso2.cep.geo.libs.executionPlanSubscriber <br/>
org.wso2.cep.geo.proximity.GeoProximity <br/>
org.wso2.cep.geo.GeoIsWithin
</code>
</p>
</div>
</div>
<div class="wizard-card" data-cardname="Update jaggery">
<h3>Update jaggery</h3>
If you get the following error when trying to login, Most probably it is cause by using outdated jaggery
server.
<div class="alert alert-danger" role="alert">
HTTP Status 500 - org.mozzila,javascript.EcmaError: TypeErrorL Cannot find tenantUser in object [object
Object].(/geo_dashboard/controllers/authentication.jag#13)
</div>
Copy <a href="https://github.com/wso2/jaggery-extensions/tree/master/carbon/module/scripts/server">this </a>directory
to your local<br/><b><i>{path_to_jaggery_server}/modules/carbon/scripts/server/</i></b> directory in Jaggery server.
</div>
<!-- begin special status cards below: -->
<div class="wizard-success">
<div class="alert alert-success" role="alert">submission succeeded!</div>
<button onClick="location.reload(true)" type="button" class="btn btn-info"><i class="fa fa-refresh"></i>
Refresh
</button>
</div>
<div class="wizard-error">
<div class="alert alert-warning" role="alert">submission had an error</div>
</div>
<div class="wizard-failure">
<div class="alert alert-danger" role="alert">submission failed</div>
</div>