Opened 4 years ago

Closed 4 years ago

#25 closed enhancement (invalid)

memphis_renderer_draw_tile() needs to inform the user if it cannot render a tile

Reported by: Jiri Techet Owned by: marius
Priority: major Milestone: 0.2
Component: Core Version: 0.1
Keywords: Cc:


In libchamplain, I've implemented a new mechanism for loading tiles. Basically, there is a chain of map sources and if one map source cannot render a tile, the next map source in the chain is used for its rendering and so on. So for instance

cache -> network_source -> error_tile_source

first tries to get the tile from the cache, if it fails it tries to get it from the network and if that fails, it loads an arror tile.

This however isn't possible with MemphisMapSource? because this function:

void memphis_renderer_draw_tile (MemphisRenderer? *r,

cairo_t *cr,
guint x,
guint y,
guint zoom_level);

cannot tell if it could render the tile successfully - even if Memphis doesn't have data for the given area, it "successfully" creates a tile with background color. What I would need is e.g. a gboolean return value that indicates when for the given area there is no map info and nothing can be rendered for the given tile. I imagine that some flag, initially set to FALSE could be used and once you draw something into the tile, it would be set to TRUE. But I haven't checked the sources so maybe there is a better way to do this.

Change History (2)

comment:1 Changed 4 years ago by simon

OK, I see. We know for which tiles we have data (memphis_renderer_tile_has_data). I will add a return value or an error object to the API if it is not possible to solve your problem by calling memphis_renderer_tile_has_data.

comment:2 Changed 4 years ago by simon

  • Resolution set to invalid
  • Status changed from new to closed

The issue was resolved by email. memphis_renderer_tile_has_data fits the problem.

Note: See TracTickets for help on using tickets.