Commit 06a09d17 authored by Christopher S Barnett's avatar Christopher S Barnett
Browse files

-initial commit merge-layers branch

-deal layers merged to single layer with dynamic styling
-styling updates to reflect filtered list of deals and roles in those deals
-included bboxes from simplified geometries without territories
-edited Russion bbox for better presentation
-added border to separate map and text panel
-selectable countries highlight on hover
parent 2dac7973
......@@ -27,6 +27,7 @@ html, body /*, and all other map parent selectors*/
width: auto;
height: 100%;
margin: 0;
border-right: 1px solid rgb(38, 38, 38);
}
div#legend {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -172,6 +172,52 @@ class ExcelToJSON:
return self.data_json
class AddSimplifiedBounds:
"""
adds bbox from simplified geometry to country geojson
"""
simplified = None
conv = None
def __init__(self, simpl_path='./world_110m.geojson', geojson_path=None):
self.geojson_path = geojson_path
self.simpl_path = simpl_path
def load_simplified(self):
with open(self.simpl_path, 'r') as json_data:
self.simplified = json.load(json_data)
def get_simplified_country(self, iso_code):
if self.simplified is None:
self.load_simplified()
for c in self.simplified['features']:
if c['properties']['ADM0_A3'] == iso_code:
return c
def get_bounds_from_feature(self, f):
if 'bbox' in f:
return f['bbox']
def add_simplified_bounds(self):
with open(self.geojson_path, 'r') as gj_data:
geojson = json.load(gj_data)
for f in geojson['features']:
fid = f['id']
c = self.get_simplified_country(fid)
if c is None:
print(fid, 'no match')
continue
bbox = self.get_bounds_from_feature(c)
if bbox is None:
print(fid, 'no bbox')
continue
f['bbox'] = bbox
with open(self.geojson_path, 'w') as outfile:
json.dump(geojson, outfile)
def convert_countries(json_data):
rows = json_data['data']
for row in rows:
......
......@@ -629,17 +629,15 @@
// window.onresize = function () {
// that._resize();
// };
// this._map.on('movestart ', function () {
// that.migration.pause();
// });
/* this._map.on('moveend', function () {
that.migration.play();
that._draw();
});*/
this._map.on('movestart ', function () {
that.migration.pause();
});
this._map.on('zoomstart ', function () {
that.container.style.display = 'none';
});
this._map.on('zoomend', function () {
this._map.on('moveend', function () {
that.migration.play();
if (that._show) {
that.container.style.display = '';
that._draw();
......
This diff is collapsed.
Markdown is supported
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