diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..855a690 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "jvectormap"] + path = jvectormap + url = git@github.com:bjornd/jvectormap.git diff --git a/app.js b/app.js new file mode 100644 index 0000000..b29c1cc --- /dev/null +++ b/app.js @@ -0,0 +1,84 @@ +var app = function(){ + var convertSvgToMap = function(svg) { + var map = {}; + + map.width = parseInt($(svg).find('svg').attr('width'), 10); + map.height = parseInt($(svg).find('svg').attr('height'), 10); + map.paths = {}; + $(svg).find('path').each(function(i){ + map.paths['id'+i] = { + path: $(this).attr('d'), + name: 'name'+i + }; + }); + return map; + }; + + var createMap = function(){ + $.fn.vectorMap('addMap', 'map', mapData); + return new jvm.WorldMap({ + container: $('#settings-map'), + map: 'map', + backgroundColor: 'white', + regionStyle: { + initial: { + fill: '#E9AB38' + } + } + }); + }; + + var renderTable = function(){ + var table = '
id | name |
---|---|
'+id+' | '+ + ''+mapData.paths[id].name+' | '+ + '