(self, zoom_level, tiles_to_load, max_tiles=None)
return tile_data_tuples
* Loads the tiles listed in tiles_to_load for the specified zoom_level.
        :param zoom_level:
        :param tiles_to_load:
        :param max_tiles:
        :return:
* Loads the tiles listed in tiles_to_load for the specified zoom_level.
        :param zoom_level:
        :param tiles_to_load:
        :param max_tiles:
        :return:
* Loads the tiles listed in tiles_to_load for the specified zoom_level . : param zoom_level : : param tiles_to_load : : param max_tiles : : return :
def load_tiles(self, zoom_level, tiles_to_load, max_tiles=None):
        """
         * Loads the tiles listed in tiles_to_load for the specified zoom_level.
        :param zoom_level:
        :param tiles_to_load:
        :param max_tiles:
        :return:
        """
        self._cancelling = False
        debug("Reading tiles of zoom level {}", zoom_level)

        if zoom_level is None:
            raise RuntimeError("zoom_level is required")

        if tiles_to_load is None:
            raise RuntimeError("tiles_to_load is required")

        if max_tiles is not None:
            center_tiles = get_tiles_from_center(
                nr_of_tiles=max_tiles, available_tiles=tiles_to_load, should_cancel_func=lambda: self._cancelling
            )
        else:
            center_tiles = tiles_to_load
        where_clause = self._get_where_clause(tiles_to_load=center_tiles, zoom_level=zoom_level)

        sql_command = "SELECT zoom_level, tile_column, tile_row, tile_data FROM tiles {};"
        sql = sql_command.format(where_clause)

        tile_data_tuples = []
        rows = self._get_from_db(sql=sql)
        count_sql = "select count(*) 'nr_of_tiles' from tiles WHERE zoom_level = {}".format(zoom_level)
        total_nr_of_tiles = self._get_single_value(count_sql, "nr_of_tiles")
        if max_tiles is not None and max_tiles < total_nr_of_tiles:
            self.tile_limit_reached.emit()

        if rows:
            self.max_progress_changed.emit(len(rows))
            for index, row in enumerate(rows):
                if self._cancelling or (max_tiles and len(tile_data_tuples) >= max_tiles):
                    break
                tile, data = self._create_tile(row)
                tile_data_tuples.append((tile, data))
                self.progress_changed.emit(index + 1)
        return tile_data_tuples
def load_tiles ( self , zoom_level , tiles_to_load , max_tiles = None ) : self . _cancelling = False debug ( "Reading tiles of zoom level {}" , zoom_level ) if zoom_level is None : raise RuntimeError ( "zoom_level is required" ) if tiles_to_load is None : raise RuntimeError ( "tiles_to_load is required" ) if max_tiles is not None : center_tiles = get_tiles_from_center ( nr_of_tiles = max_tiles , available_tiles = tiles_to_load , should_cancel_func = lambda : self . _cancelling ) else : center_tiles = tiles_to_load where_clause = self . _get_where_clause ( tiles_to_load = center_tiles , zoom_level = zoom_level ) sql_command = "SELECT zoom_level, tile_column, tile_row, tile_data FROM tiles {};" sql = sql_command . format ( where_clause ) tile_data_tuples = [ ] rows = self . _get_from_db ( sql = sql ) count_sql = "select count(*) 'nr_of_tiles' from tiles WHERE zoom_level = {}" . format ( zoom_level ) total_nr_of_tiles = self . _get_single_value ( count_sql , "nr_of_tiles" ) if max_tiles is not None and max_tiles < total_nr_of_tiles : self . tile_limit_reached . emit ( ) if rows : self . max_progress_changed . emit ( len ( rows ) ) for index , row in enumerate ( rows ) : if self . _cancelling or ( max_tiles and len ( tile_data_tuples ) >= max_tiles ) : break tile , data = self . _create_tile ( row ) tile_data_tuples . append ( ( tile , data ) ) self . progress_changed . emit ( index + 1 ) return tile_data_tuples