Jason,
sorry just getting caught up on lists after Christmas (yeah, I know).
This may not work right now, the Links block location in the XML has
to move into an Extension block at the end of the application
definition. I'm not sure the parsing code has been updated to reflect
this necessity ... I've made a note of it, though, and will try to
include it in a future update.
Cheers
Paul
On 16-Jan-08, at 1:54 PM, Jason Birch wrote:
Hi Keith,
I know this doesn't help right now, but Fusion has the concept of
layer
and group information built-in. The Legend widget has functions that
are called getLayerInfoUrl and getGroupInfoUrl that are called to add
hyperlinked images when constructing the legend.
Look around lines 504 and 515 of this file:
http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Oem/fusionframework/f
usion/trunk/widgets/Legend.js
You can trace this back to the ApplicationDefinition file which builds
the links property of the map, filling it with name/url pairs for
layers
and groups (around line 426)
http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Oem/fusionframework/f
usion/trunk/lib/ApplicationDefinition.js
Which means you can just add a structure like this to the Extension
section of the map definition in your ApplicationDefinition file
<Links>
<Group>
<Name>Roads</Name>
<Url>http://example.com/metadata/roads.html</Url>
</Group>
<Layer>
<Name>Highway</Name>
<Url>http://example.com/roads_hwy.html</Url>
</Layer>
<Layer>
<Name>Arterial</Name>
<Url>http://example.com/roads_art.html</Url>
</Layer>
</Links>
And it _should_ get picked up by the legend.
Two things:
- I haven't actually tested this to make sure it works.
- I cheated; I knew that this functionality was probably there (DMSG
implemented it for my project) but got distracted into tracking it
down.
Jason
________________________________
From: Campbell, Keith A
Subject: [mapguide-users] URL in Legend
I'd like to add a link in the legend from each layer / group to some
information about the layer (in a new window). Has anybody done this
successfully and if so, would you mind sharing how you did it?
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users