Re: NetworkMapSource and ChamplainCache change proposal



On Mon, Nov 23, 2009 at 15:17, Pierre-Luc Beaudoin
<pierre-luc pierlux com> wrote:
> On Mon, 2009-11-23 at 01:32 +0100, Jiří Techet wrote:
>> After thinking about it this looks as a much more elegant solution so
>> I'm inclined to implement this one. Your opinion?
>
> This design is interesting.  You didn't explain though how you were
> planning to make it work with changes of maps sources (which causes the
> view to reask for the sames tiles to a different MapSource).
>

Now, there is

champlain_view_set_map_source(myMapSource)

to set a map source. If we want to preserve compatibility with
existing applications, we could use this function to make the loading
chain contain only one map source (if there are already some, they
will be deleted) and add one more function,

champlain_view_append_map_source(myAdditionalMapSource)

to add more map sources into the chain. We can do something similar with caches:

champlain_view_clear_cache_list()
champlain_view_append_cache(myCache)

(contrary to map sources it should be possible to have no cache, so
champlain_view_clear_cache_list() erases the list of caches
completely)

So in the "for dummies" mode you can do:

champlain_view_set_map_source(myMapSource1)
//use myMapSource1

champlain_view_set_map_source(myMapSource2)
//use myMapSource2
//and so on

In the "advanced" mode, you can do:

champlain_view_set_map_source(myMapSource1)
champlain_view_append_map_source(myMapSource2)
champlain_view_clear_cache_list()
champlain_view_append_cache(myCache1)
champlain_view_append_cache(myCache2)
//the chain is myCache1 --> myCache2 --> myMapSource1 --> myMapSource2

champlain_view_set_map_source(myMapSource3)
champlain_view_append_map_source(myMapSource4)
//the chain is myCache1 --> myCache2 --> myMapSource3 --> myMapSource4

champlain_view_clear_cache_list()
champlain_view_append_cache(myCache3)
champlain_view_append_cache(myCache4)
//the chain is myCache3 --> myCache4 --> myMapSource3 --> myMapSource4
//and so on

However, this will always create all caches in front of map sources,
which might not be flexible enough (see my email to Emmanuel, which I
haven't written yet ;-). We might want something like

cache1 --> mapSource1 --> cache2 --> mapSource2

In this case there could be one more "super advanced mode" function
that would take the already prepared chain as its argument (something
like champlain_view_set_load_chain(chain) ). It may look like a
duplication of the above functions, but I'm just afraid that 99
percent users will use only the basic functionality and will not want
to care about any "chains" (from my experience if you want to do
something too generic, the result gets too complicated for normal
users so they rather switch to something simpler and less powerful to
avoid the complexity - and I'm talking from the users' perspective
now).

By the way, there is this function now:

champlain_view_get_map_source()

which I would like to remove completely. First, it's not so much
useful - the user should know what he used as a map source. Second, it
would have to return the complete chain, which would be confusing for
the "basic mode" users.

Jiri


> In the case of the code to be merged soon (the local rendering), you
> idea should work too!
>
> If Emmanuel likes it, I'd say its a go :)
>
> Pierre-Luc
>


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