[Geomoose-users] standard extension configuration

Andrew Sheppard asheppard at houstoneng.com
Wed Jul 11 07:45:09 PDT 2012


Hi,
As I'm updating various extensions I'm wondering if there could be a standard way to configure them.  The existing conventions seem to be:

1.       Define a configuration object within the extension file that must be edited directly (e.g. DynamicZoom)

2.       Look for a global variable to be defined in a <script> head (e.g. Disclaimer)

3.       Look for additional mapbook configuration parameters (e.g BasemapButtons)

I'd like to recommend converging on #3, but with a standard way to define parameter names so they don't conflict with other extensions or built-in parameters.  An easy choice would be to include the extension class name in the parameter name.  This would make also it easy to define defaults within the extension itself.
As an example, the Disclaimer extension would have this code added:

CONFIGURATION['DisclaimerExtension'] = {'message': 'Hello, world!'}

The mapbook could then be configured to override the default message:

<configuration>
<param name='DisclaimerExtension.message'>This is my disclaimer.</param>
</configuration>

How does this sound?

S. Andrew Sheppard
GIS/Web Developer
Houston Engineering, Inc.
www.houstoneng.com<http://www.houstoneng.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20120711/2d3f4230/attachment.html>


More information about the Geomoose-users mailing list