[mapguide-users] Developing a asp.net web site and want to embed a MGOS map

Kori Maleski km at pat.ca
Wed Jul 19 17:14:44 EDT 2006

You can embed a map as an image:
<IMG id="imgDetailMap" height="520" src="" width="425" runat=server >

In the code behind do something like the following:
Dim l_sSession As String = Page.Request("SESSION")

Dim l_dX As Double = Page.Request("X")

Dim l_dY As Double = Page.Request("Y")

Dim l_sDetailMapImage As String = GetMapImage("http://MyServer/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&VERSION=1.0.0", l_sSession, "MyMap", "Library%3A%2F%2FMyLibrary%2FMaps%2FMyMap.MapDefinition", 1200, 200, l_dX, l_dY, 425, 520)

CType(e.Item.FindControl("imgDetailMap"), HtmlImage).Src = l_sDetailMapImage

The above FindControl will vary depending on where the control is called from, this was in a databind event.
Then have a function:
Public Function GetMapImage(ByVal l_sURL As String, ByVal l_sSession As String, ByVal l_sMapName As String, ByVal l_sMapDefinition As String, ByVal l_iScale As Integer, ByVal l_iDPI As Integer, ByVal l_dCENTERX As Double, ByVal l_dCENTERY As Double, ByVal l_iWidth As Integer, ByVal l_iHeight As Integer) As String

...some magical code goes here that manipulates the X & Y projections...
GetMapImage = String.Format("{0}", l_sURL & "&MAPNAME=" & l_sMapName & "&MAPDEFINITION=" & l_sMapDefinition & "&SETVIEWCENTERX=" & l_oMGCoordinateXY.GetX().ToString() & "&SETVIEWCENTERY=" & l_oMGCoordinateXY.GetY().ToString() & "&SETVIEWSCALE=" & l_iScale.ToString() & "&SETDISPLAYDPI=" & l_iDPI.ToString() & "&SETDISPLAYWIDTH=" & l_iWidth.ToString() & "&SETDISPLAYHEIGHT=" & l_iHeight.ToString() & "&SESSION=" & l_sSession & "&LOCALE=en")


End Function

Kori Maleski  BSc. 
Senior Technical Consultant
Pacific Alliance Technologies
Suite 200 - 638 11 Ave. SW Calgary, AB CANADA T2R 0E2
TEL 403.770.1917 FAX 877.691.9149 TOL 877.691.9171 www.pat.ca <http://www.pat.ca/> 


From: Bill MacDonald [mailto:blmacdonald at agri.ns.ca]
Sent: Wed 19/07/2006 6:00 AM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Developing a asp.net web site and want to embed a MGOS map



I am trying to create an asp.net web site that will contain an embedded MGOS map.

We are currently not using a frameset and are having problems with the map reloading every time the forms posted back to the server.  


Are there any options (similar to liteview) where we could embed these maps without them reloading every time the forms are posted back?




Billy MacDonald



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 11724 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060719/0a44fa83/attachment.bin

More information about the Mapguide-users mailing list