[mapguide-users] Navigation Example .NET

Berdel, Brian brian.berdel at mcmtrans.com
Wed May 23 11:45:29 EDT 2007


I used 1.2 and it definitely works.  I put the server side code in the
gotopoint.aspx on page load then called the refresh after the
ZoomToView. 

 

 

Brian Berdel

McMahon Associates, Inc.

p: 215.283.9444

www.mcmtrans.com

________________________________

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Kenneth
Sent: Wednesday, May 23, 2007 10:03 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Navigation Example .NET

 

What version of the MapGuide server did you use?
I cannot get it to update the legend correctly, when the "summary"
parameter is present.




Regards, Kenneth, GEOGRAF A/S
 



Berdel, Brian wrote: 

I take that back...I got it to work.  

It was actually much simpler than all of this.     And Refresh does in
fact Refresh the legend. 

 

I simply had to call GetMapFrame().Refresh();

 

Before calling ZoomToView

 

All is well and it works great. 

 

Thanks again for all of your help. 

 

 

Brian Berdel

McMahon Associates, Inc.

p: 215.283.9444

www.mcmtrans.com

________________________________

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Berdel,
Brian
Sent: Tuesday, May 22, 2007 9:50 AM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Navigation Example .NET

 

I cannot get it to work with your workaround. (or with any I have tried
:-))

 I took out the summary parameter and made the change to
ajaxmappane.templ

And the map will not display at all.  This seems like a pretty basic
piece of functionality that has gone without working for a long time. I
found e-mails on this dated back to October. 

 

Thanks, 

 

Brian Berdel

McMahon Associates, Inc.

p: 215.283.9444

www.mcmtrans.com

________________________________

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Kenneth
Sent: Monday, May 21, 2007 2:33 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Navigation Example .NET

 

I can't find it either :D...

Here is the text of my post:
<snip>
When using the server API for altering layer visibility, a call to the 
GetMapFrame().Refresh() is not sufficient to refresh the legend. 

Pseudocode: 
$map.Open(...); 
$map.Layers('layername').setVisibility(true); 
$map.Save(); 

Calling the GetMapFrame().Refresh() after this, will update the map to 
display the new layer. 
However the Legend does not reflect this change. 

The problem can be solved with two changes: 
1. In ajaxmappane.templ, the Refresh() function should also call 
ResetVisLayers() 
2. In legendctrl.templ, the Refresh call should be changed, so it does 
not call with the summary parameter 

The problem only occurs in the AJAX viewer. 
When retrieving the legend script, using the summary parameter, the 
visibility does not change. 
Removing the summary parameter is a bad fix, as it also disables the 
optimizations that the summary parameter gives. 

If the above mentioned fix 1, is not implemented, a lot of features will

fail after modifying the map. 
For instance tooltips for the layers will not work. 

I think this is a problem with a design flaw in the way the viewer is 
implemented. 
Keeping state data solely on the client is a very bad idea. 
This happens with layerstates and current zoom in the AJAX viewer, and 
the Selection in the DWF viewer. 

To allow modifications to the map from the server API, all data should 
be written to the server. 
To provide caching the client should fetch a change list, rather than 
sporadically caching data. 
Using a sequence number, the client can skip multiple update cycles, and

still be synced correctly. 
Using a generic format would allow the DWF and ajax viewer to work on 
exactly the same data, thus reducing duplicate code. 

</snip>




Regards, Kenneth, GEOGRAF A/S
 



Berdel, Brian wrote: 

Looks like you are right...Thanks.  I cannot seem to find your
workaround, can you send me a link or something?

 

Thanks, 

 

Brian Berdel

McMahon Associates, Inc.

p: 215.283.9444

www.mcmtrans.com

________________________________

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Kenneth
Sent: Monday, May 21, 2007 9:58 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Navigation Example .NET

 

The zoom will invalidate the map, and is the same as a refresh.
I haven't tested it, but I don't think a scale change (eg. zoom) will
refresh the visible layer cache, but it might.





Regards, Kenneth, GEOGRAF A/S
 



Andy Morsell wrote: 

But in the example below, where the layer is being set to visible right
before a zoom, the zoom should take care of the map refresh and the
layer should appear on the subsequent map.  Or, is this not the case?

 

Andy 

________________________________

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Kenneth
Sent: Sunday, May 20, 2007 11:18 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Navigation Example .NET

If you modify the layer visibility, using serverside code, it will not
work correctly with the AJAX viewer.
The problem is that the AJAX client has a small cache of visible layers,
and calling map.refresh() on the client does not invalidate this cache.

The symptoms will be that no tooltip is displayed for the layer, and the
layer never shows up in the legend.
I've posted this bug on the mapguide-internals list, and a workaround.





Regards. Kenneth, GEOGRAF A/S
 
  



Berdel, Brian wrote: 

Cool, thanks! I'll give it a try. 

Brian Berdel

 

McMahon Associates, Inc.

 

p: 215.283.9444

 

www.mcmtrans.com

________________________________

size=2 width="100%" align=center tabindex=-1> 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Andy
Morsell
Sent: Friday, May 18, 2007 12:39 PM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Navigation Example .NET

The execution of the API functions must happen server side in this
instance.  But, it looks like you could put your .NET conditional code
in the gotopoint.aspx page and it would work.  The OnPageLoad()
javascript function would fire afterwards so all should behave smoothly.
And, you would not have to programmatically refresh the map since that
will happen with the ZoomToView anyway.

Andy 

________________________________

size=2 width="100%" align=center tabindex=-1> 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Berdel,
Brian
Sent: Friday, May 18, 2007 9:28 AM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Navigation Example .NET

Thanks for the response.  I am looking for a way to achieve this on the
client side. I do not want to check until after the user has clicked on
link. (such as putting it in the gotopoint.aspx page). Will this work
here?

Brian Berdel

 

McMahon Associates, Inc.

 

p: 215.283.9444

 

www.mcmtrans.com

________________________________

size=2 width="100%" align=center tabindex=-1> 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Andy
Morsell
Sent: Friday, May 18, 2007 11:40 AM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Navigation Example .NET

You should be able to use the MgLayer::IsVisible function to check the
visibility and then SetVisible to turn it on.  You will then have to
refresh the map to reflect the change.

Andy Morsell, P.E. 
Spatial Integrators, Inc. 
http://www.SpatialGIS.com 

________________________________

size=2 width="100%" align=center tabindex=-1> 

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Berdel,
Brian
Sent: Friday, May 18, 2007 8:00 AM
To: MapGuide Users Mail List
Subject: [mapguide-users] Navigation Example .NET

Anyone know how I would go about checking to see if a layer was on in
the navigation example and if it is not turn it when clicking a link.

Thanks!

Brian Berdel

 

McMahon Associates, Inc.

 

p: 215.283.9444

 

www.mcmtrans.com

 
 
 
 
 
 



________________________________



 
 
 
 
 
 
 
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
  
 
 
 
 
 
 
 



________________________________



 
 
 
 
 
 
 
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
  
 
 
 
 
 



________________________________



 
 
 
 
 
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
  
 



________________________________



 
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070523/0e80f544/attachment.html


More information about the mapguide-users mailing list