[mapguide-users] Two maps in the same layout
Mark Pendergraft
markp at Meadgilman.com
Wed Jan 21 11:09:43 EST 2009
Many people have their page in a frameset. Here is an example which has
two frames, 1 for a title.html page and 1 for the mapguide viewer. Here
is an example of what your frameset page might look like (in VB.NET)
**********************************
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="OSGeo.MapGuide" %>
<!-- #Include File="UtilityFunctions.aspx" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Private webLayout As String = "Library://MGA/Layout/MGA Web
Layout.WebLayout"
Private defaultUser As String = "Anonymous"
Private defaultPassword As String = ""
Private SessionId As String = ""
Private addRequests As String = ""
Private Parameters As String = ""
</script>
<%
Try
' Initialize a session and register a variable to hold the
' session id, then initialize the Web Extensions, connect
' to the site, and create a session.
InitializeWebTier()
Dim userInfo As New MgUserInformation(defaultUser,
defaultPassword)
Dim site As New MgSite()
site.Open(userInfo)
SessionId = site.CreateSession()
Catch ex As Exception
Response.Write(ex.Message)
End Try
%>
<frameset rows="50,*">
<frame id="titleFrame" frameborder="0" marginwidth="0"
marginheight="0" scrolling="no"
src="http://localhost/mapguide/mga/title.html">
<frame id="viewerFrame" frameborder="0" marginwidth="0"
marginheight="0" scrolling="no"
src="http://localhost/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%=s
essionId%>&WEBLAYOUT=<%=webLayout%>&LOCALE=en">
</frameset>
****************************
This page creates a horizontal split page with two pages in it. If you
adjusted frameset rows="50,*" to "frameset cols="*,*" you would get a
page split in half vertically. Then change the src="" element to the
two pages you want shown.
Hope that clears it up a bit.
-Mark Pendergraft
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Rodolfo
Moreno
Sent: Wednesday, January 21, 2009 7:47 AM
To: mapguide-users at lists.osgeo.org
Subject: Re: [mapguide-users] Two maps in the same layout
Hi Jackie,
I don't understand what you want to tell me, could you elaborate on your
idea?
this the code of my beginning page
<script runat="server">
String webLayout =
"Library://Samples/Sheboygan/Layouts/SheboyganAspTest.WebLayout";
String defaultUser = "Anonymous";
String defaultPassword = "";
String sessionId1 = "";
String sessionId2 = "";
</script>
<%
try
{
// Initialize a session and register a variable to hold the
// session id, then initialize the Web Extensions, connect
// to the site, and create a session.
InitializeWebTier();
MgUserInformation userInfo = new MgUserInformation(defaultUser,
defaultPassword);
MgSite site = new MgSite();
site.Open(userInfo);
sessionId1 = site.CreateSession();
site = new MgSite();
site.Open(userInfo);
sessionId2 = site.CreateSession();
}
catch (Exception e)
{
Response.Write(e.Message);
}
%>
<html>
<head>
<title>Viewer Sample Application</title>
</head>
<frameset rows="30,*" frameborder="no" framespacing="0">
<frame id="titleFrame" frameborder="no" marginwidth="0"
marginheight="0"
scrolling="no" src="title.html">
<frameset cols="50%,50%">
<frame id="viewer1Frame" frameborder="no" marginwidth="0"
marginheight="0" scrolling="no"
src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%=sessionId1%>&WEBL
AYOUT=<%=webLayout%>&THEMINGTYPE=1">
<frame id="viewer2Frame" frameborder="no" marginwidth="0"
marginheight="0" scrolling="no"
src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%=sessionId2%>&WEBL
AYOUT=<%=webLayout%>&THEMINGTYPE=2">
</frameset>
</frameset>
</html>
thanks,
Jackie Ng wrote:
>
> The easiest way is to have an outer frameset (or 2 outer iframes) that
> points to your individual ajax viewers.
>
> - Jackie
>
>
> Rodolfo Moreno wrote:
>>
>> I want to put two maps in the same layout and moreover each map must
be
>> themed in different way just after of that the application to be
loaded
>> (the theming must be done automatically according to a placed
preference
>> in the first time that the application to be loaded).
>>
>> I did a test application usign ajax viewer and I got it, however I
have
>> modified many files of the mapguide extensions (MAINFRAME.ASPX,
>> FRAMESETTASKBAR.TEMPL, FRAMESETNOTASKBAR.TEMPL, MAPFRAME.ASPX,
>> AJAXMAPPANE.TEMPL).
>> I would like to know if it's possible to achieve it without the need
of
>> modifying that files?
>> Also I'd like to know if it's possible to do it in FUSION viewer (I
>> prefer FUSION than AJAXVIEWER).
>>
>> I am attaching a image of my test application.
>>
>> thanks in advance,
>>
>> http://n2.nabble.com/file/n2189508/testApp.jpg
>>
>
>
-----
Rodolfo Moreno
CivilEng
--
View this message in context:
http://n2.nabble.com/Two-maps-in-the-same-layout-tp2189508p2192823.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
More information about the mapguide-users
mailing list