[Mapbender-dev] Application element interaction
Christoph Baudson (Wheregroup)
christoph.baudson at wheregroup.com
Tue Mar 23 12:46:06 EDT 2010
I have already sent this mail 5 hours ago...maybe it got lost
--
Hello folks,
Karim and I had been discussing how application elements could interact
in the future. We wanted to establish a more user friendly way of
configuring how elements collaborate. Based on that discussion I have
made a prototypical implementation.
The scenario consists of two elements, a button for digitizing a
polygon, and a feature list. I want the feature list to automatically
display the polygons that are being digitized, without having to change
the source code.
I have added an element var "inputs" for the feature list, which looks
like this:
[{
"type": "featureCollection",
"method": "addFeatureCollection",
"title": "Features that will be added to the feature list",
"linkedTo": [
{
"id": "mb_digitize_polygon",
"event": "finished",
"attr": "featureCollection",
}
]
}]
This JSON snippet specifies that the feature list has an input of a
specific "type" ("featureCollection"), and input data can be added via
an API "method" ("addFeatureCollection").
This input is then linked to the output of the polygon digitizer,
specified by "id". The output is generated whenever an "event" is
triggered ("finished"), and the listener can access the output via the
attribute "attr" ("featureCollection") of the object passed into the
callback.
With this approach, we can create very flexible configurations. I
imagine an admin UI similar to Yahoo Pipes, where you can connect your
elements by drawing a line from element A to B, complete with default
settings and validation. The JSON above would be generated automatically.
Thanks to the Mapbender API the code necessary to do this is only about
20 lines [1], there is no need to add code to existing elements.
What do you think about this approach? I think it would be a great
feature and make configurations very easy, and it would also give
element designers a structure to code to. I would love to have that in
Mapbender 3.x, maybe for FOSS4G.
Christoph
[1] http://osgeo.pastebin.com/0SwNFUvU
--
----------------------------------
Aufwind durch Wissen!
Qualifizierte OpenSource-Schulungen
bei der www.foss-academy.eu
----------------------------------
_______________________________________
W h e r e G r o u p GmbH & Co. KG
Siemensstraße 8
53121 Bonn
Germany
Christoph Baudson
Anwendungsentwickler
Fon: +49 (0)228 / 90 90 38 - 15
Fax: +49 (0)228 / 90 90 38 - 11
christoph.baudson at wheregroup.com
www.wheregroup.com
Amtsgericht Bonn, HRA 6788
_______________________________________
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
_______________________________________
More information about the Mapbender_dev
mailing list