--- a/src/hdalab/static/hdalab/js/gomina.js Thu Feb 26 12:39:23 2015 +0100
+++ b/src/hdalab/static/hdalab/js/gomina.js Thu Feb 26 13:42:26 2015 +0100
@@ -91,25 +91,26 @@
function showCountriesLeaflet(geoJson) {
gomNs.countries = {};
- var gJ = new L.GeoJSON();
- gJ.on('featureparse', function(_f) {
- var isocode = _f.id;
- _f.layer.setStyle({
- color: "#000000",
- weight: .5,
- fillOpacity: 1,
- fillColor: "rgb(" + gomNs.zeroColor.join(",") + ")"
- });
- _f.layer.on('click', function() {
- addFilter('country', _f.properties.dbpedia_uri);
- });
- gomNs.countries[_f.properties.dbpedia_uri] = {
- "properties" : _f.properties,
- "layer" : _f.layer
+
+ L.geoJson(
+ geoJson, {
+ onEachFeature : function(_f, layer) {
+ var isocode = _f.id;
+ layer.setStyle({
+ color: "#000000",
+ weight: .5,
+ fillOpacity: 1,
+ fillColor: "rgb(" + gomNs.zeroColor.join(",") + ")"
+ });
+ layer.on('click', function() {
+ addFilter('country', _f.properties.dbpedia_uri);
+ });
+ gomNs.countries[_f.properties.dbpedia_uri] = {
+ "properties" : _f.properties,
+ "layer" : layer
+ }
}
- });
- gJ.addGeoJSON(geoJson);
- gomNs.map.addLayer(gJ);
+ }).addTo(gomNs.map);
}
function addFilter(_type, _label) {
@@ -758,8 +759,11 @@
case 'leaflet':
gomNs.map = new L.Map('map', {
center: new L.LatLng(30, 0),
- zoom: 1
+ zoom: 0.80,
+ minZoom: 0.80,
+ zoomControl: false
});
+ gomNs.map.addControl(new L.Control.ZoomMin())
//gomNs.map.addLayer(new L.TileLayer("http://s3.amazonaws.com/com.modestmaps.bluemarble/{z}-r{y}-c{x}.jpg", {maxZoom: 9}));
$.getJSON(gomNs.urls['countries'], showCountriesLeaflet);
break;