4964: Gramps crashed during web report generation with person place maps
svn: r17684
This commit is contained in:
parent
e2ad5452cc
commit
59b324df39
@ -4027,8 +4027,8 @@ class IndividualPage(BasePage):
|
|||||||
if not place_lat_long:
|
if not place_lat_long:
|
||||||
return
|
return
|
||||||
|
|
||||||
MinX, MaxX = "0.00000001", "0.00000001"
|
minX, maxX = "0.00000001", "0.00000001"
|
||||||
MinY, MaxY = "0.00000001", "0.00000001"
|
minY, maxY = "0.00000001", "0.00000001"
|
||||||
XCoordinates, YCoordinates = [], []
|
XCoordinates, YCoordinates = [], []
|
||||||
|
|
||||||
number_markers = len(place_lat_long)
|
number_markers = len(place_lat_long)
|
||||||
@ -4039,15 +4039,21 @@ class IndividualPage(BasePage):
|
|||||||
YCoordinates.append(long)
|
YCoordinates.append(long)
|
||||||
|
|
||||||
XCoordinates.sort()
|
XCoordinates.sort()
|
||||||
MinX = XCoordinates[0]
|
minX = XCoordinates[0] if XCoordinates[0] is not None
|
||||||
MaxX = XCoordinates[-1]
|
maxX = XCoordinates[-1] if XCoordinates[-1] is not None
|
||||||
|
|
||||||
YCoordinates.sort()
|
YCoordinates.sort()
|
||||||
MinY = YCoordinates[0]
|
minY = YCoordinates[0] if YCoordinates[0] is not None
|
||||||
MaxY = YCoordinates[-1]
|
maxY = YCoordinates[-1] if YCoordinates[-1] is not None
|
||||||
|
|
||||||
spanY = int( Decimal( MaxY ) - Decimal( MinY ) )
|
try:
|
||||||
spanX = int( Decimal( MaxX ) - Decimal( MinX ) )
|
spanY = int( Decimal( maxY ) - Decimal( minY ) )
|
||||||
|
except:
|
||||||
|
spanY = 0
|
||||||
|
try:
|
||||||
|
spanX = int( Decimal( maxX ) - Decimal( minX ) )
|
||||||
|
except:
|
||||||
|
spanX = 0
|
||||||
|
|
||||||
# define smallset of Y and X span for span variables
|
# define smallset of Y and X span for span variables
|
||||||
smallset = set(xrange(-17,18))
|
smallset = set(xrange(-17,18))
|
||||||
@ -4155,10 +4161,10 @@ class IndividualPage(BasePage):
|
|||||||
# set southWest and northEast boundaries as spanY is greater than 20
|
# set southWest and northEast boundaries as spanY is greater than 20
|
||||||
jsc += """
|
jsc += """
|
||||||
// boundary southWest equals bottom left GPS Coordinates
|
// boundary southWest equals bottom left GPS Coordinates
|
||||||
var southWest = new mxn.LatLonPoint(%s, %s);""" % (MinX, MinY)
|
var southWest = new mxn.LatLonPoint(%s, %s);""" % (minX, minY)
|
||||||
jsc += """
|
jsc += """
|
||||||
// boundary northEast equals top right GPS Coordinates
|
// boundary northEast equals top right GPS Coordinates
|
||||||
var northEast = new mxn.LatLonPoint(%s, %s);""" % (MaxX, MaxY)
|
var northEast = new mxn.LatLonPoint(%s, %s);""" % (maxX, maxY)
|
||||||
jsc += """
|
jsc += """
|
||||||
var bounds = new google.maps.LatLngBounds(southWest, northEast);
|
var bounds = new google.maps.LatLngBounds(southWest, northEast);
|
||||||
map.fitBounds(bounds);"""
|
map.fitBounds(bounds);"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user