Tiles sources and renderers for markers (the clipped POI problem)



Hi,

I want to explain a little bit a problem emerged from the development
of POIs feature as part of Rishi GSoC, it's not a hard to solve
problem but is better to discuss it now :)

In the current Rishi's development code for retrieving and showing
POIs we use the POIMapSource (Champlain.TileSource) class to fetch the
markers from Overpass for each map tiles and POIRenderer
(Champlain.Renderer) to add the POI markers actors as children of the
tile actor.

The problem comes with the rendering, it's not correct to render
markers into a tile, but into the whole view. This is because a
portion of the marker actors that are close to the edge of the tile
needs to be rendered outside the tile, so, that portion of marker is
clipped and overlapped by other tiles.

To solve this we need to add the markers to the whole map view,
rather, to a layer.

I propose a solution to this, which is the easiest and most obvious :)

POIRenderer should know about the map view or a set of layers (one or
more), I propose that the it should know about the map view, so
POIRenderer is in charge to create the layers. The POIRenderer::render
just need to fill the corresponding layers with markers instead of
composite the tile actor, actually, we don't need the tile actor at
all in this method (and this is because this solution is a bit ugly),
with this solution, we can keep the caching and tile based fetching
algorithms provided by Champlain.

Also, it would be appropriate to create some base classes to modeling
this kind of overlays, like: MarkerOverlaySource and
MarkerOverlayRenderer, which POI code and the new feature to show
contacts check-in's could use as base classes.

As a value added, this solution allows to implement filters for POIs
and other markers in Maps by hiding showing layers.

Opinions and suggestions are required :)

Cheers!
Damián


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]