-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
159 lines (128 loc) · 4.06 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
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>e-YAKA template
</title>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha256-/SIrNqv8h6QGKDuNoLGA4iret+kyesCkHGzVUUV0shc="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
crossorigin="anonymous">
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<style>
body {
margin: 0;
padding: 0;
}
#mapid {
height: 100vh;
}
</style>
</head>
<body>
<div class="container-fluid">
<div id="mapid"></div>
</div>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Le coup de téléphone à prospect <img src="telephone.gif" /></h4>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div id="dialog" class="col-sm-6"><p>Partie Dialog</p></div>
<div id="info" class="col-sm-6"><p>Partie Info Aquis</p></div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" onclick="fun()">Appeleer</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
var yx = L.latLng;
var xy = function(x, y) {
if (L.Util.isArray(x)) { // When doing xy([x, y]);
return yx(x[1], x[0]);
}
return yx(y, x); // When doing xy(x, y);
};
var icon = L.icon({
iconUrl: 'icon.png',
iconSize: [40, 40], // size of the icon
iconAnchor: [20, 10], // point of the icon which will correspond to marker's location
popupAnchor: [0, 0] // point from which the popup should open relative to the iconAnchor
});
var bounds = [[0,0], [1000,1000]];
var map = L.map('mapid',{
crs: L.CRS.Simple,
maxBounds:L.latLngBounds(xy(0,0),xy(1000,1000)),
zoom:5
});
map.setView([51.505, -0.09], 1);
var image = L.imageOverlay('france.png', bounds).addTo(map);
map.fitBounds(bounds);
var marker = L.marker(xy(500,500), {icon: icon});
marker.addTo(map);
var popup = marker.bindPopup('<button type="button" class="btn btn-info btn-xs" data-toggle="modal" data-target="#myModal">Appeler prospect</button>');
var marker2 = L.marker(xy(200,700), {icon: icon});
marker2.addTo(map);
var popup2 = marker2.bindPopup('<button type="button" class="btn btn-warning btn-xs disabled">Prospect perdu</button>');
var dialog_phrases = [
"Blah blah?",
"Blah blah, blah blah foobar.",
"Byah, blah vlah?",
"Blegh nieght blah.",
"Yieagh, blough blegh.",
"Ploum blah bleh.",
"Byah keh pleh",
"Blagh gloogh.",
"Blah blah blap.",
"Blah plat, blahahahahahahah.",
"Blahahahahahahah"
];
var info_phrases = [
"Companie: Orange",
"Interessé par: Post-it",
"Statut: Client potentiel"
]
var dialog = $("#dialog");
var info = $("#info");
var i = 0;
var j = 0;
var ab;
function display(){
if(i%2==0){
dialog.append("<p class='text-info'>"+dialog_phrases[i]+"</p>");
}
else{
dialog.append("<p class='text-success'>"+dialog_phrases[i]+"</p>");
}
if(i%4==0){
info.append("<p>"+info_phrases[j]+"</p>");
j++;
}
i++;
if(i>=9){
clearInterval(ab);
}
}
function fun(){
ab=setInterval(function(){display()},1000);
}
</script>
</body>
</html>