Permalink
Browse files

remove display of map by default

  • Loading branch information...
afourmy committed Sep 19, 2017
1 parent 92e7a1c commit 91379e2364c0b10df5c50ee428c5900f584c95c7
View
Binary file not shown.
File renamed without changes.
View
@@ -235,7 +235,12 @@ def __init__(self, path_app, test=False):
new_project.setStatusTip('Create a new project')
new_project.triggered.connect(self.add_project)
kml_export_icon = QIcon(join(self.path_icon, 'globe.png'))
shapefile_import_icon = QIcon(join(self.path_icon, 'shapefile_import.png'))
shapefile_import = QAction(shapefile_import_icon, 'Shapefile import', self)
shapefile_import.setStatusTip('Import a shapefile (.shp)')
shapefile_import.triggered.connect(self.shapefile_import)
kml_export_icon = QIcon(join(self.path_icon, 'kml_export.png'))
kml_export = QAction(kml_export_icon, 'Export to Google Earth', self)
kml_export.setStatusTip('Export project to Google Earth (.kml)')
kml_export.triggered.connect(self.kml_export)
@@ -317,6 +322,8 @@ def __init__(self, path_app, test=False):
toolbar.resize(1500, 1500)
toolbar.setIconSize(QtCore.QSize(70, 70))
toolbar.addAction(new_project)
toolbar.addSeparator()
toolbar.addAction(shapefile_import)
toolbar.addAction(kml_export)
toolbar.addSeparator()
toolbar.addAction(selection_mode)
@@ -440,6 +447,17 @@ def add_project(self, name=None):
self.dict_project[name] = new_project
return new_project
@update_paths
def shapefile_import(self, _):
filepath = QFileDialog.getOpenFileName(
self,
'Import shapefile',
'Choose a shapefile to import'
)[0]
if filepath:
self.view.world_map.shapefile = filepath
self.view.world_map.redraw_map()
def kml_export(self):
self.google_earth_export_window.show()
@@ -489,11 +507,11 @@ def debug(self):
self.debug_window.show()
@update_paths
def show_hide_map(self):
def show_hide_map(self, _):
self.view.world_map.show_hide_map()
@update_paths
def delete_map(self):
def delete_map(self, _):
self.view.world_map.delete_map()
def refresh(self):
View
@@ -312,7 +312,6 @@ def excel_export(self, selected_file=None):
excel_workbook = xlwt.Workbook()
for obj_subtype, properties in object_ie.items():
print(obj_subtype, properties)
# we have one excel sheet per subtype of object.
# we filter the network pool based on the subtype to
# retrieve only the object of the corresponding subtype
@@ -107,18 +107,14 @@ def __init__(self, view):
self.view = view
self.proj = 'Spherical'
self.ratio, self.offset = 1/1000, (0, 0)
self.shapefile = join(self.view.controller.path_shapefiles, 'World countries (low resolution).shp')
self.display = True
self.polygons = self.view.scene.createItemGroup([])
# brush for water and lands
self.water_brush = QBrush(QColor(64, 164, 223))
self.land_brush = QBrush(QColor(52, 165, 111))
self.land_pen = QPen(QColor(52, 165, 111))
# draw the map
self.polygons = self.view.scene.createItemGroup(self.draw_polygons())
self.draw_water()
def to_geographical_coordinates(self, x, y):
px, py = (x - self.offset[0])/self.ratio, (self.offset[1] - y)/self.ratio
return self.projections[self.proj](px, py, inverse=True)

0 comments on commit 91379e2

Please sign in to comment.