[mapguide-users] Custom layouts...
Ryider Grey
ryiser at yahoo.com
Fri Jun 29 11:36:16 EDT 2007
Hello Jason,
my name is dimy and I noticed that you received the following message from Alain last year. Were you able to get his example to work? If so I would like to know how you handled the following. I am having some trouble.
"The reference to the AJAX viewer in the legend control code was hardcoded. I
changed this and I will submit the change to the mapguide trunk shortly. The
reference to the legend control from the AJAX viewer is hold by a variable
so all needs to be done is changing the content of this variable to point to
the new control."
Do you know which reference to the legend control should be changed and which content variable should be changed as well/
Thanks so much for your help,
Dimy
----- Original Message ----
Jason,
I attached a couple HTML pages that show you a possible approach in
displaying the legend control in another place In this example the legend
control runs in an IFrame at the right of the viewer (see screen snapshot
below
This approach requires no code change in the template files. The main issue
is that the legend control and the viewer call each other, the viewer to set
the scale as the map is navigated, or to refresh the control among other
things, and the legend control to change the visibility of layers and
groups. When the frame hosting the control changes, the way the control and
the viewer reference each other in the code needs to change as well. The
reference to the AJAX viewer in the legend control code was hardcoded. I
changed this and I will submit the change to the mapguide trunk shortly. The
reference to the legend control from the AJAX viewer is hold by a variable
so all needs to be done is changing the content of this variable to point to
the new control.
The sample script legendpane.html shows you how to wait for the map to be
fully initialed, create a new legend control (not the new parameter MAPFRAME
to the LegendCtrl.php request), and when this control is fully initialized,
sets a reference to it in the AJAX viewer. From that point on the AJAX
viewer will interact with the new control.
The drawback of this approach is that the initial legend control is still
there, only not visible. But its not a big deal, the control is inactive
after you attached the new instance to the AJAX viewer. The advantage of
this approach, which to my opinion far outweighs the drawback, is that it
requires no change in the existing surround.
Alain
____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070629/6c9f78d0/attachment.html
More information about the mapguide-users
mailing list