Re[mapguide-users] freshing a map/layer... from server side, avoiding JavaScript

Kenneth, GEOGRAF A/S ks at geograf.dk
Tue Nov 13 07:34:49 EST 2007


I don't think that it is the MG libraries that lack the "push", it is 
the HTTP protocol/Web browser that is not well suited for this.

There are ways to perform a server push, but it is uncommon, so examples 
can be hard to find.
The problem would be getting the viewer to respond to such pushes.

If you design your own viewer, you can do just that.
Building a simple viewer is easier than it sounds, you just have to call 
the "GETMAPIMAGE" operation, and supply the parameters.
You can do this without any server side code, or without any client side 
code (you will need code somewhere though).

 From your other message, you worry about the syncronization.
If you want the refresh to be in sync with the server call, you can use 
a structure like this:

client:
document.getElementById('hiddeniframe').location.href = 
'loooongoperation.aspx?action=go';

server:
lenghty_operation_call();
Response.Clear();
Response.Write("<html><body><script>parent.document.getElementById('mapstuff').Refresh();</script></body></html>");
Response.Flush();

This will ensure that the map is not refreshed until the actual server 
operation completes.
You can modify it to be more "AJAX" like, but the overall approach still 
applies.

Regards, Kenneth, GEOGRAF A/S



Maksim Sestic skrev:
> Just one more thing to add... :-) I don't understand why MG libraries lack
> that "push" functionality. If there's a session established, then there's a
> way to influence the representation of a map as user sees it - refreshing,
> panning, zooming, all sorts of pre and post-processing... using existing,
> server-side MG functionality. Currently I'm forced to turn to scripting
> languages for majority of the tasks. Such code is _hard_ to maintain. Take,
> for example, a vehicle tracking system.
>
> Regards,
> Maksim Sestic
>   


More information about the mapguide-users mailing list