Commit 214eef5c authored by stef's avatar stef
Browse files

[fix] faster map loading

parent 1a4e64f4
$script.ready('kartograph', function() {
$(document).ready(function() {
var onCountryClick = function(target) {
window.location='/list/'+target.iso2+"/";
};
......@@ -6,43 +6,13 @@ $script.ready('kartograph', function() {
window.map = $K.map('#map');
map.loadMap('/site_media/eu.svg', function(map) {
map
.addLayer({'id': 'eu',
'className': 'bgback',
filter: function(d) {
if(country.length==2) {
return d.iso2 == country;
}
return true;
}
})
.addLayer({'id': 'eu',
'className': 'bg',
filter: function(d) {
if(country.length==2) {
return d.iso2 == country;
}
return true;
}
})
.addLayer({'id': 'eu',
'className': 'bgstroke',
filter: function(d) {
if(country.length==2) {
return d.iso2 == country;
}
return true;
}
})
.addLayer('eu', 'bgback')
.addLayer('eu', 'bg')
.addLayer('eu', 'bgstroke')
.addLayer({'id': 'countries', 'className': 'context'})
.addLayer('graticule')
.addLayer({'id': 'eu',
'className': 'fg',
filter: function(d) {
if(country.length==2) {
return d.iso2 == country;
}
return true;
},
'tooltip': {
content: function(obj,foo) {
var count=0;
......
......@@ -11,16 +11,17 @@
{% block scripts %}
<script type="text/javascript" src="{{ MEDIA_URL }}/js/script.min.js"></script>
<script type="text/javascript">
$script(['{{ MEDIA_URL }}/js/jquery.min.js'], 'jquery');
$script(["{{ MEDIA_URL }}/js/jquery.tablesorter.min.js", "{{ MEDIA_URL }}/js/picnet.table.filter.min.js"], 'tables');
$script(['{{ MEDIA_URL }}/js/raphael.min.js', '{{ MEDIA_URL }}/js/kartograph.min.js', '{{ MEDIA_URL }}/js/chroma.min.js', '{{ MEDIA_URL }}/js/qtip.min.js'], 'kartograph');
</script>
<script type="text/javascript" src="{{ MEDIA_URL }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/js/picnet.table.filter.min.js"></script>
<script type="text/javascript" src='{{ MEDIA_URL }}/js/raphael.min.js'></script>
<script type="text/javascript" src='{{ MEDIA_URL }}/js/kartograph.min.js'></script>
<script type="text/javascript" src='{{ MEDIA_URL }}/js/chroma.min.js'></script>
<script type="text/javascript" src='{{ MEDIA_URL }}/js/qtip.min.js'></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/js/map.js"></script>
<script type="text/javascript">
var data={% if countryweights %}{{countryweights|safe}}{%else%}[]{% endif %};
var country="{{country}}";
$script.ready(['jquery','tables'], function() {
$(document).ready(function() {
$.tablesorter.addParser({
// set a unique id
......@@ -60,9 +61,7 @@
$(this).parent().hide();
});
});
});
</script>
<script type="text/javascript" src="{{ MEDIA_URL }}/js/map.js"></script>
{% endblock %}
{%block content%}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment