forked from seanlebeck/site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexmapsnew.html
506 lines (397 loc) · 21.3 KB
/
indexmapsnew.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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="author" content="Roman S. Stepanov" />
<title>MapSVG: create cozy interative vector maps / floorplans with jQuery / WordPress plugin</title>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<link href="css/bootstrap-responsive.css" rel="stylesheet"/>
<link href="css/base.css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/raphael.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="js/mapsvg.min.js?v=5.5.4"></script>
<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>
<script type="text/javascript">
if(window.location.protocol=="file:"){
$(document).ready(function(){
$('#main-body').prepend('<div class="alert alert-error" style="margin-top: 20px;">SVG map files can\'t be loaded when HTML file is just opened from local folder - because JavaScript don\'t have access to files on your local machine. Please upload demo to server to see maps.</div>');
});
}
</script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="index.html">mapSVG</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active">
<a href="index.html">Overview</a>
</li>
<li>
<a href="_documentation.html">Documentation: jQuery</a>
</li>
<li>
<a href="_wp_documentation.html">Documentation: WordPress</a>
</li>
<li class="">
<a href="_faq.html">FAQ</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="jumbotron masthead">
<div class="container">
<h1>mapSVG</h1>
<p>Create cozy interactive maps and floorplans.</p>
<div class="btn-group" id="buy-btn">
<a class="btn btn-large btn-danger dropdown-toggle" data-toggle="dropdown" href="#">Buy on CodeCanyon <span class="caret"></span></a>
<ul class="dropdown-menu" id="cc-dropdown">
<li><a href="http://codecanyon.net/item/jquery-interactive-svg-map-plugin/1694201?ref=Yatek" style="text-align: left; text-shadow: none;">jQuery plugin →</a></li>
<li><a href="http://codecanyon.net/item/mapsvg-interactive-vector-maps/2547255?ref=Yatek" style="text-align: left; text-shadow: none;">WordPress plugin →</a></li>
</ul>
<script type="text/javascript">
var b = $('#buy-btn').width();
$('#cc-dropdown').width(b);
</script>
</div>
<ul class="masthead-links">
<li>
Current jQuery plugin version: 5.5.4
</li>
<li>
WordPress plugin version: 1.4.4
</li>
</ul>
</div>
</div>
<div class="bs-docs-social">
<div class="container">
<ul class="bs-docs-social-buttons">
<li class="follow-btn">
<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/follow_button.1352365724.html#_=1353139811317&id=twitter-widget-1&lang=en&screen_name=oyatek&show_count=true&show_screen_name=true&size=m" class="twitter-follow-button" style="width: 242px; height: 20px;" title="Twitter Follow Button" data-twttr-rendered="true"></iframe>
</li>
<li class="tweet-btn">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://map.karaliki.ru" data-text="Create interactive vector maps and floorplans with mapSVG plugin" data-via="oyatek">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</li>
<li class="tweet-btn">
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fmap.karaliki.ru&send=false&layout=button_count&width=150&show_faces=false&action=like&colorscheme=light&font=verdana&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:21px;" allowTransparency="true"></iframe>
</li>
</ul>
</div>
</div>
<div class="container" id="main-body">`
<div class="page-header">
<h1>MapSVG: jQuery and WordPress plugin</h1>
</div>
<div class="alert">MapSVG takes map files in SVG format and makes them interactive.</div>
<p>
You can use mapSVG for: <span class="label label-important">country maps</span> <span class="label label-success">city maps</span> <span class="label label-info">subway maps</span> <span class="label label-warning">floorplans</span>
</p><br />
<h3>Main features</h3>
<div class="alert alert-info">
Try to click / move mouse pointer over colored countries and markers.
</div>
<div id="mapsvg-2"></div>
<h5>Some cool things you can do</h5>
<ul>
<li><strong>Zoom & pan</strong> the map (zoom by mouswheel, click & hold mouse button to pan)</li>
<li>Map is <strong>responsive</strong> - it auto adjusts its size for small screens. Try to resize browser's window</li>
<li>Set custom <strong>onClick, mouseOver, mouseOut</strong> event handlers.</li>
<li><strong>Show user's location on World Map</strong> (try to hover mouse pointer on the red marker). </li>
<li><strong>Add markers with latitude/longitude coordinates</strong>. Please note that this feature is available only for World Map and only in plain jQuery version of the plugin. Other maps support markers only with x/y coordinates</li>
</ul>
<script type="text/javascript">
var currentLocation = [geoip_latitude(), geoip_longitude()];
$('#mapsvg-2').mapSvg({
source: 'maps/world_with_states.svg', // Path to SVG map
colors: {stroke: '#aaaaaa', selected: -20, hover: 7},
width: 1170,
onClick: function(e,m){
if(this.node.id=='Mongolia') return;
var obj = this.mapsvg_type == 'region' ? '<b>'+this.node.id+'</b>' : 'a <b>marker</b>';
m.showPopover(e,'You clicked '+obj+' and this is a pop-up info box with close button. <br />You can put <ins>any</ins> <strong>HTML</strong> <em>tags</em> here. <br />Also it\'s useful for links: <a href="http://google.com" target="_blank">google.com</a>');
},
marks: [
{ c: currentLocation,
attrs: {'src': 'markers/pin1_red.png'},
tooltip: '<strong>You are here!</strong><br />'
+geoip_city()+'<br />'
+geoip_country_name()+'<br />'
+'Coordinates: '+currentLocation
},
{ c: [38.927099,-77.021713],
attrs: {'src': 'markers/pin1_yellow.png'},
tooltip: '<strong>Washington, DC</strong><br />This marker is set by latitude / longitude coordinates:<br />38.893438, -77.03167'
},
{ c: [51.49763,-0.148315],
attrs: {'src': 'markers/pin1_green.png'},
tooltip: '<strong>London</strong><br />Coordinates: 51.49763, -0.148315'
}
,
{ c: [33.504759,100.283203],
attrs: {'src': 'markers/pin1_blue.png'},
tooltip: '<strong>China</strong> is disabled for demonstration purpose -<br />so it isn\'t clickable or selectable.'
}
],
regions: {
Mexico: {
tooltip: 'You can set any colors and styles for any region.<br />',
attr:{fill: '#F3E4B2'}
},
Russia: {
tooltip: '<strong>Russia:</strong> Click here to see a popover box',
attr:{fill: '#FF9176'},
popover: 'This is info box with close button. <br />You can put <ins>any</ins> <strong>HTML</strong> <em>tags</em> here. <br />Also it\'s useful for links: <a href="http://google.com" target="_blank">google.com</a>'
},
China: {
disabled: true,
attr: {fill: '#F7D5BA'}
},
Mongolia: {
tooltip: '<strong>Mongolia:</strong> link to <em>google.com</em> is attached to this country. <br />Try to click! (link will open in new window).',
attr:{fill: '#A4DFA3', href: 'http://map/&t=1'}
},
Kazakhstan: {
tooltip: '<strong>Kazakhstan:</strong> tooltips can contain any HTML:<br /><img src="http://farm9.staticflickr.com/8162/7706013408_80a182713f_m.jpg"/>',
attr:{fill: '#F9DD7B'}
}
},
tooltipsMode: 'combined',
zoom: 1,
pan:1,
responsive:1,
zoomLimit: [-100,100]
});
</script>
<button class="btn btn-info" onclick="$('#js-code').toggle();return false;">Show JavaScript code for the map above</button>
<br /><br /><br />
<pre id="js-code" style="display: none;">
var currentLocation = [geoip_latitude(), geoip_longitude()];
$('#mapsvg-2').mapSvg({
source: 'maps/world_high.svg', // Path to SVG map
colors: {base: '#cccccc', stroke: '#aaaaaa', selected: 10},
tooltipsMode: 'combined',
zoom: true,
pan: true,
responsive: true,
width: 1170,
zoomLimit: [0,100],
onClick: function(e,m){
if(this.node.id=='Mongolia') return;
var obj = this.mapsvg_type == 'region' ? '<b>'+this.node.id+'</b>' : 'a <b>marker</b>';
m.showPopover(e,'You clicked '+obj+' and this is a pop-up info box with close button. <br />You can put <ins>any</ins> <strong>HTML</strong> <em>tags</em> here. <br />Also it\'s useful for links: <a href="http://google.com" target="_blank">google.com</a>');
},
marks: [
{ c: currentLocation,
attrs: {'src': 'markers/pin1_red.png'},
tooltip: '<strong>You are here!</strong><br />'
+geoip_city()+'<br />'
+geoip_country_name()+'<br />'
+'Coordinates: '+currentLocation
},
{ c: [38.893438,-77.03167],
attrs: {'src': 'markers/pin1_yellow.png'},
tooltip: '<strong>Washington, DC</strong><br />This marker is set by latitude / longitude coordinates:<br />38.893438, -77.03167'
},
{ c: [51.49763,-0.148315],
attrs: {'src': 'markers/pin1_green.png'},
tooltip: '<strong>London</strong><br />Coordinates: 51.49763, -0.148315'
}
,
{ c: [33.504759,100.283203],
attrs: {'src': 'markers/pin1_blue.png'},
tooltip: '<strong>China</strong> is disabled for demonstration purpose -<br />so it isn't clickable or selectable.'
}
],
regions: {
USA: {
tooltip: '<strong>USA:</strong> As you can see, you can paint regions in any colors.<br />',
attr:{fill: '#F3E4B2'}
},
Russia: {
tooltip: '<strong>Russia:</strong> Click here to see a popover box',
attr:{fill: '#FF9176'},
},
China: {
disabled: true,
attr: {fill: '#F7D5BA'}
},
Mongolia: {
tooltip: '<strong>Mongolia:</strong> link to <em>google.com</em> is attached to this country. <br />Try to click! (link will open in new window).',
attr:{fill: '#A4DFA3', href: 'http://google.com', target: 'blank'}
},
Kazakhstan: {
tooltip: '<strong>Kazakhstan:</strong> tooltips can contain any HTML:<br /><img src="http://farm9.staticflickr.com/8162/7706013408_80a182713f_m.jpg"/>',
attr:{fill: '#F9DD7B'}
}
}
});
</pre>
<h3 id="usa-counties">USA Counties - detailed map of each state</h3>
<div class="alert">Obviously USA map is most demanded, so it's included in the plugin. <br />
But also I was often asked for a map of some state with its counties - so finally <strong>detailed maps of each state</strong> with <strong>all counties</strong> were added.<br />
Each state map is in separate .svg file.
</div>
<div class="alert alert-info">
Click on any state to load detailed map with counties.
</div>
<div class="row" style="overflow: hidden;">
<div class="span6">
<div id="mapsvg-usa"></div>
</div>
<div class="span6" id="mapsvg-states-cont">
<div id="mapsvg-states" style="min-height: 200px;"></div>
</div>
</div>
<script type="text/javascript">
$('#mapsvg-usa').mapSvg({source: 'maps/usa.svg', width: 1200, responsive: 1,
colors: {background: 'transparent', hover: 4, selected: 10, stroke: '#ffffff'},
tooltipsMode: 'names',
regions: {'TX': {selected: true}},
onClick: function(){
var file = 'usa-'+this.name.toLowerCase()+'.svg';
console.log($('#mapsvg-states').html());
if($('#mapsvg-states').find('svg').length){
$('#mapsvg-states').mapSvg().destroy();
}
$('#mapsvg-states').mapSvg({
source : 'maps/counties/'+file,
//responsive: 1,
colors: {background: 'transparent', base: "#DDDDDD", stroke: '#ffffff'},
width: $('#mapsvg-usa').width(),
height: $('#mapsvg-usa').height(),
tooltipsMode: 'names',
zoomButtons: {show: true, location: 'right'},
zoom: 1,
pan: 1
});
}
});
$('#mapsvg-states').mapSvg({
source : 'maps/counties/usa-tx.svg',
responsive: 1,
colors: {background: 'transparent', stroke: '#ffffff'},
width: $('#mapsvg-usa').width(),
tooltipsMode: 'names',
zoomButtons: {show: true, location: 'right'},
zoom: 1,
pan: 1
});
</script>
<script type="text/javascript">
$('#maplinks a').on('click', function(e){
e.preventDefault();
var file = $(this).attr('data-svg');
if($('#mapsvg-other').find('svg').length){
$('#mapsvg-other').empty().mapSvg().destroy();
}
$('#mapsvg-other').mapSvg({
source : 'maps/'+file,
responsive: 1,
width: $('#mapsvg-other-cont').width(),
height: $('#mapsvg-other-cont').height(),
tooltipsMode: 'names',
zoomButtons: {show: true, location: 'left'},
zoom: 1,
pan: 1
});
});
</script>
<br /><br />
<h3>Other SVG maps included in mapSVG plugin</h3>
<div class="alert">
Remember that <strong>you can add your own .SVG maps</strong>. There are many free SVG maps available for downloading from Wikipedia storage. Or you can draw your own map / floorplan in vector editor and save it as ".svg" file.
</div>
<div class="alert alert-info">
↓ Select any map from menu
</div>
<div class="row" style="overflow: hidden;">
<div class="span3">
<ul id="maplinks" class="nav nav-tabs nav-stacked other-maps">
<li><a href="#" data-svg="world_high.svg">World</a></li>
<li><a href="#" data-svg="world_with_states.svg">World with USA states</a></li>
<li><a href="#" data-svg="usa.svg">USA</a></li>
<li><a href="#" data-svg="usa-labels.svg">USA + short labels</a></li>
<li><a href="#" data-svg="usa-labels-full.svg">USA + full labels</a></li>
<li><a href="#" data-svg="europe.svg">Europe</a></li>
<li><a href="#" data-svg="asia.svg">Middle Asia</a></li>
<li><a href="#" data-svg="africa.svg">Africa</a></li>
<li><a href="#" data-svg="russia.svg">Russia</a></li>
<li><a href="#" data-svg="canada.svg">Canada</a></li>
<li><a href="#" data-svg="australia.svg">Australia</a></li>
<li><a href="#" data-svg="norway.svg">Norway</a></li>
<li><a href="#" data-svg="japan.svg">Japan</a></li>
<li><a href="#" data-svg="germany.svg">Germany</a></li>
<li><a href="#" data-svg="italy.svg">Italy</a></li>
<li><a href="#" data-svg="mexico.svg">Mexico</a></li>
<li><a href="#" data-svg="brazil.svg">Brasil</a></li>
<li><a href="#" data-svg="switzerland.svg">Switzerland</a></li>
<li><a href="#" data-svg="malaysia.svg">Malaysia</a></li>
</ul>
</div>
<div class="span9" id="mapsvg-other-cont">
<div id="mapsvg-other"></div>
</div>
</div>
<script type="text/javascript">
$('#maplinks a').on('click', function(e){
e.preventDefault();
var file = $(this).attr('data-svg');
if($('#mapsvg-other').find('svg').length){
$('#mapsvg-other').empty().mapSvg().destroy();
}
$('#mapsvg-other').mapSvg({
source : 'maps/'+file,
responsive: 1,
colors: {base: '#cccccc', stroke: "#999999", selected: 9, hover: 5},
regions: {labels: {attr: {fill: '#555555'}}},
width: $('#mapsvg-other-cont').width(),
tooltipsMode: 'names',
zoomButtons: {show: true, location: 'left'},
zoom: 1,
pan: 1
});
});
</script>
<h3>Support</h3>
<p>
I'm always happy to help - but please read <a href="http://map.karaliki.ru/_faq.html">FAQ</a> before mailing me.
</p>
<h3>Need to draw a custom map / floorplan?</h3>
<p>
Just mail me from my <a href="http://codecanyon.net/user/Yatek?ref=Yatek">profile page</a> on CodeCanyon (message form is on bottom right corner).
</p>
<h3>Need some features which mapSVG doesn't have yet?</h3>
<p>
You can order custom develompent, mail me from my <a href="http://codecanyon.net/user/Yatek?ref=Yatek">profile page</a> on CodeCanyon (message form is on bottom right corner).
</p>
<h3>Websites using mapSVG</h3>
<a href="http://www.services-ges.com/en/ges-worldwide">services-ges.com</a><br />
<a href="http://theafricachannel.com/africa/">theafricachannel.com</a><br />
<a href="http://www.neele.nl/">neele.nl</a><br />
<br /><br />
</div>
<div style="text-align: center; padding: 70px 0; border-top: 1px solid #dddddd; background: #fafaf5" >
<div class="btn-group" id="buy-btn" style="margin: 0 auto;">
<a class="btn btn-large btn-danger dropdown-toggle" data-toggle="dropdown" href="#">Buy mapSVG on CodeCanyon <span class="caret"></span></a>
<ul class="dropdown-menu" id="cc-dropdown">
<li><a href="http://codecanyon.net/item/jquery-interactive-svg-map-plugin/1694201?ref=Yatek" style="text-align: left; text-shadow: none;">jQuery plugin →</a></li>
<li><a href="http://codecanyon.net/item/mapsvg-interactive-vector-maps/2547255?ref=Yatek" style="text-align: left; text-shadow: none;">WordPress plugin →</a></li>
</ul>
</div>
</div>
</body>
</html>