def _calc_bounds(self, change): markers = change["new"] locations = [marker.location for marker in markers] latitudes = [location[0] for location in locations] longitudes = [location[1] for location in locations] min_latitude, max_latitude = bounds.latitude_bounds(latitudes) min_longitude, max_longitude = bounds.longitude_bounds(longitudes) self.data_bounds = [(min_latitude, min_longitude), (max_latitude, max_longitude)]
def _calc_bounds(self, change): markers = change['new'] if markers: locations = [marker.location for marker in markers] latitudes = [location[0] for location in locations] longitudes = [location[1] for location in locations] min_latitude, max_latitude = bounds.latitude_bounds(latitudes) min_longitude, max_longitude = bounds.longitude_bounds(longitudes) self.data_bounds = [(min_latitude, min_longitude), (max_latitude, max_longitude)] self.has_bounds = True else: self.has_bounds = False
def _calc_bounds(self, change): markers = change['new'] if markers: locations = [marker.location for marker in markers] latitudes = [location[0] for location in locations] longitudes = [location[1] for location in locations] min_latitude, max_latitude = bounds.latitude_bounds(latitudes) min_longitude, max_longitude = bounds.longitude_bounds(longitudes) self.data_bounds = [ (min_latitude, min_longitude), (max_latitude, max_longitude) ] self.has_bounds = True else: self.has_bounds = False
def _latitude_bounds(self, latitudes): return bounds.latitude_bounds(latitudes)