]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/osm_plugin_GeoJSON_popup_patch.mdwn
review
[ikiwiki.git] / doc / todo / osm_plugin_GeoJSON_popup_patch.mdwn
1 [[!template  id=gitbranch branch=cbaines/osm-popup-fixes author="[[cbaines]]"]]
2 [[!tag patch]]
3
4 When using the GeoJSON output of the OSM plugin (osm_format: GeoJSON), the name and description in the popups are missing, this patch fixes the issue.
5
6 > "Pass the layers given in the OSM directive through"
7 >
8 > It would be good if the commit added documentation for the new feature,
9 > probably in `doc/ikiwiki/directive/osm.mdwn`.
10 >
11 >     + my @layers = [ 'OSM' ];
12 >
13 > You mean `$layers`. `[]` is a scalar value (a reference to an array);
14 > `@something` is an array.
15 >
16 >     +         @layers = [ split(/,/, $params{layers}) ];
17 >
18 > Is comma-separated the best fit here? Would whitespace, or whitespace and/or
19 > commas, work better?
20 >
21 > It's difficult to compare without knowing what the values would look like.
22 > What would be valid values? The documentation for `$config{osm_layers}`
23 > says "in a syntax acceptable for OpenLayers.Layer.OSM.url parameter" so
24 > perhaps:
25 >
26 >     # expected by current branch
27 >     \[[!osm layers="OSM,WTF,OMG"]]
28 >     \[[!osm layers="http://example.com/${z}/${x}/${y}.png,http://example.org/tiles/${z}/${x}/${y}.png"]]
29 >     # current branch would misbehave with this syntax but it could be
30 >     made to work
31 >     \[[!osm layers="OSM, WTF, OMG"]]
32 >     \[[!osm layers="""http://example.com/${z}/${x}/${y}.png,
33 >       http://example.org/tiles/${z}/${x}/${y}.png"""]]
34 >     # I would personally suggest whitespace as separator (split(' ', ...))
35 >     \[[!osm layers="OSM WTF OMG"]]
36 >     \[[!osm layers="""http://example.com/${z}/${x}/${y}.png
37 >       http://example.org/tiles/${z}/${x}/${y}.png"""]]
38 >
39 > If you specify more than one layer, is it like "get tiles from OpenCycleMap
40 > server A or B or C as a round-robin", or "draw OpenCycleMap and then overlay
41 > county boundaries and then overlay locations of good pubs", or what?
42 >
43 >     +         layers => @layers,
44 >
45 > If @layers didn't have exactly one item, this would mess up argument-parsing;
46 > but it has exactly one item (a reference to an array), so it works.
47 > Again, if you replace @layers with $layers throughout, that would be better.
48 >
49 >     -        $options{'layers'} = $config{osm_layers};
50 >
51 > Shouldn't the default if no `$params{layers}` are given be this, rather
52 > than a hard-coded `['OSM']`?
53 >
54 > `getsetup()` says `osm_layers` is `safe => 0`, which approximately means
55 > "don't put this in the web UI, changing it could lead to a security flaw
56 > or an unusable website". Is that wrong? If it is indeed unsafe, then
57 > I would expect changing the same thing via \[[!osm]] parameters to be
58 > unsafe too.
59 >
60 > I notice that `example => { 'OSM', 'GoogleSatellite' }` is wrong:
61 > it should (probably) be `example => [ 'OSM', 'GoogleSatellite' ]`
62 > (a list of two example values, not a map with key 'OSM' corresponding
63 > to value 'GoogleSatellite'. That might be why you're having trouble
64 > with this.
65 >
66 > "Fix the title and description of map popups"
67 >
68 >    +                  # Rename desc to description (this matches the kml output)
69 >
70 > Is there a spec for this anywhere, or a parser with which it needs to be
71 > compatible?
72 >
73 > --[[smcv]] [[!tag reviewed]]