Monday, July 05, 2010

MapGuide: Using Fusion with Selection Events (aka reports)

Sometimes, you just want to do simple things and it seems frustrating. I was
frustrated and I solved it, here's my contribution back!

Having come into the geo-spatial world with Autodesk MapGuide in the 6.x series (aka classic),
the world was a lot simpler. The MapGuide Open Source Classic (or
Basic Viewer) made things easy to make a url launch from a selection. Fusion is a
little different, here's some pointers :)

MapGuide Fusion (aka flexible layouts) is a bit more technical to use, but is also
far more powerful, being based on OpenLayers.

If you want to launch a report, or popup window form a selection you need to
register an event to handle the selection.

The answer is pretty simple, as this mailing list post explains.

It's all you need to know to get started and hacking.

If it doesn't work, flip into Firefox, with Firebug enabled and dump
the sel inside the function selectionCallback(sel) and add a line to
window.console.info(sel); and see what your dealing with!

Learning by trying is the best way to learn

MapGuide Central for a good starting point for playhing with MapGuide, Openlayers and Fusion.

2 comments:

Mohammad said...

Hello,
i have a problem when i want to use base layer groups(tiles) in fusion!
i have some different groups and i want to display all of them on the map but just the upper group is displayed on the map, and when i unchecked it in the legend it remains visible on the map!!
but all works in basic viewers perfectly!
any suggestion...
thanks in advanced

Zac Spitzer / Fastmovingtarget said...

please ask such questions on the mailing list, including version numbers of fusion / mapguide in use