2017-07-01 22:16:47 +02:00
|
|
|
/**
|
2018-07-15 17:11:21 +02:00
|
|
|
* jVectorMap version 1.2.2
|
2017-07-01 22:16:47 +02:00
|
|
|
*
|
2018-07-15 17:11:21 +02:00
|
|
|
* Copyright 2011-2013, Kirill Lebedev
|
|
|
|
* Licensed under the MIT license.
|
2017-07-01 22:16:47 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
(function( $ ){
|
|
|
|
var apiParams = {
|
|
|
|
set: {
|
|
|
|
colors: 1,
|
|
|
|
values: 1,
|
|
|
|
backgroundColor: 1,
|
|
|
|
scaleColors: 1,
|
|
|
|
normalizeFunction: 1,
|
|
|
|
focus: 1
|
|
|
|
},
|
|
|
|
get: {
|
|
|
|
selectedRegions: 1,
|
|
|
|
selectedMarkers: 1,
|
|
|
|
mapObject: 1,
|
|
|
|
regionName: 1
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.vectorMap = function(options) {
|
|
|
|
var map,
|
|
|
|
methodName,
|
2018-07-15 17:11:21 +02:00
|
|
|
event,
|
2017-07-01 22:16:47 +02:00
|
|
|
map = this.children('.jvectormap-container').data('mapObject');
|
|
|
|
|
|
|
|
if (options === 'addMap') {
|
2018-07-15 17:11:21 +02:00
|
|
|
jvm.WorldMap.maps[arguments[1]] = arguments[2];
|
2017-07-01 22:16:47 +02:00
|
|
|
} else if ((options === 'set' || options === 'get') && apiParams[options][arguments[1]]) {
|
|
|
|
methodName = arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1);
|
|
|
|
return map[options+methodName].apply(map, Array.prototype.slice.call(arguments, 2));
|
|
|
|
} else {
|
|
|
|
options = options || {};
|
|
|
|
options.container = this;
|
2018-07-15 17:11:21 +02:00
|
|
|
map = new jvm.WorldMap(options);
|
2017-07-01 22:16:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
})( jQuery );
|