diff --git a/src/DataViews/GeoView.py b/src/DataViews/GeoView.py
index 091aef608..26557f028 100644
--- a/src/DataViews/GeoView.py
+++ b/src/DataViews/GeoView.py
@@ -4,9 +4,10 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2009 Serge Noiraud
+# Copyright (C) 2008 Benny Malengier
+# Copyright (C) 2009 Gerald Britton
# Copyright (C) 2009 Helge GRAMPS
# Copyright (C) 2009 Josip
-# Copyright (C) 2008 Benny Malengier
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -90,6 +91,16 @@ NB_MARKERS_PER_PAGE = 200
#
#-------------------------------------------------------------------------
+_HTMLHEADER = '''
+
+
+
+ This is used to pass messages between javascript and python
+
+
+
+
+'''
+
#-------------------------------------------------------------------------
#
# Functions
@@ -189,18 +213,24 @@ def _get_sign(value):
return 0
def _get_zoom_lat(value):
+ """
+ return the zoom value for latitude depending on the distance.
+ """
zoomlat = 1
- for i, x in enumerate([80.0, 40.0, 20.0, 10.0, 3.0,
+ for i, distance in enumerate([80.0, 40.0, 20.0, 10.0, 3.0,
2.0, 1.0, 0.5, 0.2, 0.1]):
- if value < x:
+ if value < distance:
zoomlat = i+1
return zoomlat + 2
def _get_zoom_long(value):
+ """
+ return the zoom value for longitude depending on the distance.
+ """
zoomlong = 1
- for i, x in enumerate([120.0, 60.0, 30.0, 15.0, 7.0,
+ for i, distance in enumerate([120.0, 60.0, 30.0, 15.0, 7.0,
4.0, 2.0, 1.0, .5, .2, .1]):
- if value < x:
+ if value < distance:
zoomlong = i+1
return zoomlong + 2
@@ -216,6 +246,7 @@ class GeoView(HtmlView):
def __init__(self, dbstate, uistate):
HtmlView.__init__(self, dbstate, uistate, title=_('GeoView'))
+ self.dbstate = dbstate
self.dbstate.connect('database-changed', self._new_database)
self.usedmap = "openstreetmap"
self.displaytype = "person"
@@ -224,6 +255,7 @@ class GeoView(HtmlView):
self.nbpages = 0
self.yearinmarker = []
self.mustcenter = False
+ self.external_url = False
self.centerlat = 0.0
self.centerlon = 0.0
self.setattr = True
@@ -711,110 +743,16 @@ class GeoView(HtmlView):
)
return
-
- self.mapview.write("\n")
- self.mapview.write("