blob: 4895aa5aef813009e27e3be71e65a59c6de11fd3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
[[!template id=gitbranch branch=anarcat/master author="[[anarcat]]"]]
I got tired of hacking at the osm.pm every time I wanted to change the layers, so I made it so the layers can be changed in the .setup file. In my master branch, there are now two new configuration settings: `osm_layers` and `osm_layers_order` which replace the hackish `osm_mapurl`. The variables are a hash and an array that allow the operator to define the list of URLs to be loaded as layers and also to change the order of layers. -- [[users/anarcat]]
> I try to avoid adding hashes to config, because websetup does
> not allow configuring hashes.
>
> The example for `osm_layers_order` is confusing, it makes
> it look like a perl hash, but it appears to really be a javascript
> code fragement string, and one that is tightly bound to other
> configuration too. Why not generate that javascript code from
> data in a robust way?
>
> Does it even make sense to configure this stuff globally?
> Could the layers be passed as parameters to the osm direction? --[[Joey]]
>
> > The reason for `osm_layers_order` is that order is important in the layers: the default layer is the first one and it's not possible to force Perl to have arrays generated in a reliable, reproducable order. Maybe an alternative would be to just set the default layer.
> >
> > That said - maybe you're right and this should be passed as an argument to the OSM directive. The problem then is that you need to pass this stuff around the waypoint directive too. It also makes it hard to have a consistent set of maps all across the wiki. On our site, we have map inserts here and there, and it's nice to have them consistent all around.
> >
> > In closing, I would say that I agree that `.._order` is confusing: maybe I should just have a `_default` to choose the first one? -- [[anarcat]]
|