From ddc7e79efcaf34882ebde1440a8697dd2b2d8436 Mon Sep 17 00:00:00 2001 From: smcv Date: Wed, 17 Sep 2014 03:21:53 -0400 Subject: [PATCH] respond --- ...rror_TypeError:_mapProjection_is_null.mdwn | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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..3de7a3760 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,13 @@ 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 -- 2.39.5