[mapguide-users] Zooming / Moving to a point on the map using
the Server Side API
Gunter Becker
gunter.becker at CSOGIS.DE
Wed Jun 25 02:43:58 EDT 2008
Hi Carl,
you can use the WebTier API to move and zoom to a special extent. That is
the same the AjaxViewer does. You have to do a server side web request like
you can see in the code below:
string url = WebDomain +
"/mapguide/mapagent/mapagent.fcgi?OPERATION=GETVISIBLEMAPEXTENT&VERSION=1.0.0"
+
"&SESSION=" + MgSessionId +
"&MAPNAME=" + MapName +
"&SETVIEWCENTERX=" + Convert.ToString(x, CultureInfo.InvariantCulture)
+
"&SETVIEWCENTERY=" + Convert.ToString(y, CultureInfo.InvariantCulture)
+
"&SETVIEWSCALE=" + MapScale.ToString();
System.Net.WebRequest ZoomToViewRequest = System.Net.WebRequest.Create(url);
//WebRequest
System.Net.WebResponse ZoomToViewResponse = ZoomToViewRequest.GetResponse();
Gunter
Carl Jokl wrote:
>
> I wanted to ask about the process which you have to go through in order to
> use the MapGuide server side API to move the map position and zoom.
>
> The simple functionality seems to exist on the client side via the
> JavaScript libraries to move the map to a given x, y, position via just a
> just a function call. Inspite of my digging around though I can't find any
> such functionality for the Server side API though I might not be looking
> in the right place.
>
> It has been suggested that it might require loading, modifying and saving
> XML definitions to achieve this (though this seems like a complicated way
> of doing things). Does anyone have an example of moving / zooming the map
> from the Server API?
>
> I would not have thought it would be rocket science. For larger, more
> intricate and complex mapping systems such as the one we are working on it
> would be expected the bulk of the business logic would exist on the server
> in the form of libraries there and so doing as much as possible on the
> server is desirable. A the end of the day the JavaScript function
> "ZoomToView" I would expect must call something on the server.
>
--
View this message in context: http://www.nabble.com/Zooming---Moving-to-a-point-on-the-map-using-the-Server-Side-API-tp18091159p18106073.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list