X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7a9b0888393365c982d728033732e140271510f1..cfc5d5d9ed1a5c76212fecd592639aaa3de9b784:/doc/bugs/osm_plugin_error_TypeError:_mapProjection_is_null.mdwn diff --git a/doc/bugs/osm_plugin_error_TypeError:_mapProjection_is_null.mdwn b/doc/bugs/osm_plugin_error_TypeError:_mapProjection_is_null.mdwn index 1b2d40a12..82bebbbcf 100644 --- a/doc/bugs/osm_plugin_error_TypeError:_mapProjection_is_null.mdwn +++ b/doc/bugs/osm_plugin_error_TypeError:_mapProjection_is_null.mdwn @@ -25,12 +25,25 @@ Here's [[smcv]]'s review from [[todo/osm_plugin_GeoJSON_popup_patch]], annotated >> Or `@layers = ( 'OSM' );`. --[[anarcat]] +>>> Yeah, and then `layers => [@layers]` or `layers => \@layers` +>>> to turn it into a reference when building `%options`. --s + > + @layers = [ split(/,/, $params{layers}) ]; > > Is comma-separated the best fit here? Would whitespace, or whitespace and/or > commas, work better? ->> Why don't we simply keep it an array as it already is? I fail to see the reason behind that change. This is the config I use right now on http://reseaulibre.ca/: +>> Why don't we simply keep it an array as it already is? I fail to see the reason behind that change. +>> +>>> This seems to be at least partially a feature request for \[[!osm]]: +>>> "allow individual \[[!osm]] maps to override `$config{osm_layers}`. +>>> Items in `%config` can be a reference to an array, so that's fine. +>>> However, parameters to a [[ikiwiki/directive]] cannot be an array, +>>> so for the directive, we need a syntax for taking a scalar parameter +>>> and splitting it into an array - comma-separated, whitespace-separated, +>>> whatever. --s +>> +>> This is the config I use right now on http://reseaulibre.ca/: >> >> ~~~~ >> osm_layers: @@ -107,3 +120,15 @@ Here's [[smcv]]'s review from [[todo/osm_plugin_GeoJSON_popup_patch]], annotated >> That is an accurate statement. >> >> This is old code, so my memory may be cold, but i think that the "layers" parameters used to be a hash, not an array, until two years ago (commit 636e04a). The javascript code certainly expects an array right now. --[[anarcat]] + +>>> OK, then I think this might be a mixture of a bug and a feature request: +>>> +>>> * bug: the configuration suggested by the example (or the default when +>>> unconfigured, or something) produces "TypeError: mapProjection is null" +>>> +>>> * feature request: per-\[[!osm]] configuration to complement the +>>> per-wiki configuration +>>> +>>> --s +>>> +>>>> That is correct. --[[anarcat]]