-
Notifications
You must be signed in to change notification settings - Fork 0
/
js.js
111 lines (87 loc) · 2.47 KB
/
js.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
$(document).ready( function () {
$('#customZoomIn').bind('click', function(){
map.zoomIn();
});
$('#customZoomOut').bind('click', function(){
map.zoomOut();
});
$('#zoomToMaxExtent').bind('click', function(){
map.setView(new L.LatLng(-18.9156, 47.5218),15);
});
$('#map').addClass('map-cursor-default');
$('#btnSearch').click(function(){
if(!$('#rightpanel').hasClass('chat-view')){
$('#rightpanel').addClass('chat-view');
}
if($('#rp-edition').hasClass('active')){
$('#rp-edition').removeClass('active');
}
$('#rp-search').addClass('active');
$('#map').mouseover(function(){
$('#map').removeClass('map-edit');
$('#map').addClass('map-cursor-default');
})
edit=false;
});
$('.btnRightPanelClose').click(function(){
$('#rightpanel').removeClass('chat-view');
});
$('#btnEdition').click(function(){
if(!$('#rightpanel').hasClass('chat-view')){
$('#rightpanel').addClass('chat-view');
}
if($('#rp-search').hasClass('active')){
$('#rp-search').removeClass('active');
}
$('#rp-edition').addClass('active');
edit=true;
$('#map').mouseover(function(){
/*$('#map').removeClass('map-cursor-default');
$('#map').addClass('map-edit');*/
$('#map').awesomeCursor('plus',{
// The color of the cursor
color: '#2B83CB',
size: 22,
hotspot: [8,10],
flip: '',
rotate: 0,
outline: null,
font: {
family: 'FontAwesome',
cssClass: 'fa fa-md fa-fw fa-%s'
}
});
})
});
/*$('#rightpanel').awesomeCursor('arrows', {
// The color of the cursor
color: '#000000',
// The size of the cursor
size: 18,
// The string descriptor for the hotspot location
// x and y offsets hotspot: [0, 17]
// or using a string descriptor: hotspot: 'bottom left'
hotspot: [0, 0],
// Cursors can be flipped horizontally, vertically, or in both directions
// 'horizontal', 'vertical' or 'both'
flip: '',
// Cursor can be rotated any number of degrees
// rotate: 45
rotate: 0,
// specify an outline color for cursors
outline: null,
// To use a different font, the font option must be set to an object,
// specifying the font family and the CSS class format for icons.
font: {
family: 'FontAwesome',
cssClass: 'fa fa-%s'
}
});*/
function onMapClick(e) {
if(edit==true){
map.removeLayer(marker);
marker = L.marker(e.latlng,{draggable:true, riseOnHover:true, clickable:true, id:'marker_id'}).addTo(map);
}
}
map.on('click', onMapClick);
});