Re: [mapguide-users] Two maps in the same layout
This is trickier than it should be :( Ideally it should pass an argument which is the map that triggered the event or set the context (this) to be the map, but neither happens. Fortunately there are many ways around this ... Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded.bind(null, 'Map')); Map1.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded.bind(null, 'Map1')); ... which is essentially equivalent to .. Map.registerForEvent(Fusion.Event.MAP_LOADED, function() { mapLoaded('Map'); }); Map1.registerForEvent(Fusion.Event.MAP_LOADED, function() { mapLoaded('Map'); }); where mapLoaded now takes a parameter function mapLoaded(s) { switch(s) { case 'Map': //Map was loaded break; case 'Map1': //Map1 was loaded break; } } You can also do something really simple: Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); Map1.registerForEvent(Fusion.Event.MAP_LOADED, map1Loaded); ... function mapLoaded() {} function map1Loaded() {} Cheers Paul On 29-Jan-09, at 10:06 AM, Rodolfo Moreno wrote: Thanks Jackie and Paul for the quickly answer. I was testing the two ways. Paul with respect to the FUSION viewer, I could place two maps in the same layout, however I could not handle suitably the event MAP_LOADED. this is my code: var Map; var Map1; var fusionInitialized = function() { $('AppContainer').resize({forceResize: true}); Map = Fusion.getWidgetById('Map'); Map1 = Fusion.getWidgetById('Map1'); Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); Map1.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); } function mapLoaded() { // Inside of this function I would like to detect which of the maps(Map or Map1) has called // to this function. } I would like that mapLoaded function to detect which of the maps(Map or Map1) called it. The other alternative (whether the other is not possible) would be I can send parameters to the mapLoaded function, like this: { ... Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded, parameter1); } function mapLoaded(parameter1) { } Thanks in advance, Paul Spencer wrote: yes you can do it using the fusion viewer but you need to edit the ApplicationDefinition.xml file manually (you can't do it using Studio). You need to have a MapGroup for each map you want to display and a WidgetSet for each map you want to display. Then you need two divs in your page, one for each WidgetSet (referenced by the MapWidget in the WidgetSet). Widgets within each widget set will only work on the associated map. Cheers Paul On 22-Jan-09, at 3:21 PM, Rodolfo Moreno wrote: Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users - Rodolfo Moreno CivilEng -- View this message in context: http://n2.nabble.com/Two-maps-in-the-same-layout-tp2189508p2239370.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Two maps in the same layout
Thanks Paul, it works, it means that the parameter is being passed to the mapLoaded function. However I think that I have detected an issue with MAP_LOADED event in IE7 (in FF2 it works good) how you know I have two maps (MAP, MAP1). So the MAP_LOADED event is not calling to mapLoaded function for MAP and whether do it for MAP1. It happens in IE7. In FF2 both maps are calling to the mapLoaded function (work correctly). After I tested with MAP_BUSY_CHANGED event and I could detect the same issue. the following is a summarize of the test case: # times called during the initial loading of the application Events IE FF MAP_BUSY_CHANGED map 1 4 map1 3 4 MAP_LOADED map 0 (*) 1 map11 1 (*) 0 means that the function never is called maybe the others EVENTS have the same error. Regards, Paul Spencer wrote: This is trickier than it should be :( Ideally it should pass an argument which is the map that triggered the event or set the context (this) to be the map, but neither happens. Fortunately there are many ways around this ... Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded.bind(null, 'Map')); Map1.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded.bind(null, 'Map1')); ... which is essentially equivalent to .. Map.registerForEvent(Fusion.Event.MAP_LOADED, function() { mapLoaded('Map'); }); Map1.registerForEvent(Fusion.Event.MAP_LOADED, function() { mapLoaded('Map'); }); where mapLoaded now takes a parameter function mapLoaded(s) { switch(s) { case 'Map': //Map was loaded break; case 'Map1': //Map1 was loaded break; } } You can also do something really simple: Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); Map1.registerForEvent(Fusion.Event.MAP_LOADED, map1Loaded); ... function mapLoaded() {} function map1Loaded() {} Cheers Paul On 29-Jan-09, at 10:06 AM, Rodolfo Moreno wrote: Thanks Jackie and Paul for the quickly answer. I was testing the two ways. Paul with respect to the FUSION viewer, I could place two maps in the same layout, however I could not handle suitably the event MAP_LOADED. this is my code: var Map; var Map1; var fusionInitialized = function() { $('AppContainer').resize({forceResize: true}); Map = Fusion.getWidgetById('Map'); Map1 = Fusion.getWidgetById('Map1'); Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); Map1.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); } function mapLoaded() { // Inside of this function I would like to detect which of the maps(Map or Map1) has called // to this function. } I would like that mapLoaded function to detect which of the maps(Map or Map1) called it. The other alternative (whether the other is not possible) would be I can send parameters to the mapLoaded function, like this: { ... Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded, parameter1); } function mapLoaded(parameter1) { } Thanks in advance, Paul Spencer wrote: yes you can do it using the fusion viewer but you need to edit the ApplicationDefinition.xml file manually (you can't do it using Studio). You need to have a MapGroup for each map you want to display and a WidgetSet for each map you want to display. Then you need two divs in your page, one for each WidgetSet (referenced by the MapWidget in the WidgetSet). Widgets within each widget set will only work on the associated map. Cheers Paul On 22-Jan-09, at 3:21 PM, Rodolfo Moreno wrote: Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users - Rodolfo Moreno CivilEng -- View this message in context: http://n2.nabble.com/Two-maps-in-the-same-layout-tp2189508p2239370.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users - Rodolfo Moreno CivilEng -- View this message in context: http://n2.nabble.com/Two-maps-in-the-same-layout-tp2189508p2247494.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org
Re: [mapguide-users] Two maps in the same layout
Thanks Jackie and Paul for the quickly answer. I was testing the two ways. Paul with respect to the FUSION viewer, I could place two maps in the same layout, however I could not handle suitably the event MAP_LOADED. this is my code: var Map; var Map1; var fusionInitialized = function() { $('AppContainer').resize({forceResize: true}); Map = Fusion.getWidgetById('Map'); Map1 = Fusion.getWidgetById('Map1'); Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); Map1.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded); } function mapLoaded() { // Inside of this function I would like to detect which of the maps(Map or Map1) has called // to this function. } I would like that mapLoaded function to detect which of the maps(Map or Map1) called it. The other alternative (whether the other is not possible) would be I can send parameters to the mapLoaded function, like this: { ... Map.registerForEvent(Fusion.Event.MAP_LOADED, mapLoaded, parameter1); } function mapLoaded(parameter1) { } Thanks in advance, Paul Spencer wrote: yes you can do it using the fusion viewer but you need to edit the ApplicationDefinition.xml file manually (you can't do it using Studio). You need to have a MapGroup for each map you want to display and a WidgetSet for each map you want to display. Then you need two divs in your page, one for each WidgetSet (referenced by the MapWidget in the WidgetSet). Widgets within each widget set will only work on the associated map. Cheers Paul On 22-Jan-09, at 3:21 PM, Rodolfo Moreno wrote: Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users - Rodolfo Moreno CivilEng -- View this message in context: http://n2.nabble.com/Two-maps-in-the-same-layout-tp2189508p2239370.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Two maps in the same layout
yes you can do it using the fusion viewer but you need to edit the ApplicationDefinition.xml file manually (you can't do it using Studio). You need to have a MapGroup for each map you want to display and a WidgetSet for each map you want to display. Then you need two divs in your page, one for each WidgetSet (referenced by the MapWidget in the WidgetSet). Widgets within each widget set will only work on the associated map. Cheers Paul On 22-Jan-09, at 3:21 PM, Rodolfo Moreno wrote: Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Two maps in the same layout
Hi Mark, about your question: - Why would you need to modify any of the viewer files in order to have 2 pages in your map? I have modified viewer files because I want to set a themed layer dynamically in each map in the first time that my application to be loaded. My use case is: The theming is placed according to a preference to set by the user in previous session. Thus the applicacion could show two preferences on the same map(and the same layout). This is useful when you want to show comparisons, for example: To compare population 1980 vs 1990 (like a dashboard). Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? Thanks, Ivan Milicevic wrote: Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout 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
RE: [mapguide-users] Two maps in the same layout
Only for completing my idea about the dynamic theming in the first time: frame id=viewer1Frame frameborder=no marginwidth=0 marginheight=0 scrolling=no src=/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId1%WEBLAYOUT=%=webLayout%THEMINGTYPE=1 In this sentence you can see a parameter added called THEMINGTYPE, which is why I have modified the viewer files. I have not found another way of doing theming dynamically in the first time. I would like to do it without modifying the viewer files and much better if it is possible to do in FUSION viewer. Thanks in advance, Rodolfo Moreno wrote: Hi Mark, about your question: - Why would you need to modify any of the viewer files in order to have 2 pages in your map? I have modified viewer files because I want to set a themed layer dynamically in each map in the first time that my application to be loaded. My use case is: The theming is placed according to a preference to set by the user in previous session. Thus the applicacion could show two preferences on the same map(and the same layout). This is useful when you want to show comparisons, for example: To compare population 1980 vs 1990 (like a dashboard). Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? Thanks, Ivan Milicevic wrote: Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout 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
RE: [mapguide-users] Two maps in the same layout
Sorry, I didn't thoroughly read your original question. So I'll try again. The main problem here is that you can't initially theme because you don't have access to the runtime map(s) as the viewer's haven't loaded yet. What you can do is hook on the viewer's loading process (like so: http://trac.osgeo.org/mapguide/wiki/CodeSamples/JavaScript/AJAXViewerEventHooking) and invoke a server-side script that does the theming passing in your map's name (which will now be available) and any other theming parameters. When the theming script has completed, refresh the affected viewer. Hope that helps. - Jackie Rodolfo Moreno wrote: Only for completing my idea about the dynamic theming in the first time: frame id=viewer1Frame frameborder=no marginwidth=0 marginheight=0 scrolling=no src=/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId1%WEBLAYOUT=%=webLayout%THEMINGTYPE=1 In this sentence you can see a parameter added called THEMINGTYPE, which is why I have modified the viewer files. I have not found another way of doing theming dynamically in the first time. I would like to do it without modifying the viewer files and much better if it is possible to do in FUSION viewer. Thanks in advance, Rodolfo Moreno wrote: Hi Mark, about your question: - Why would you need to modify any of the viewer files in order to have 2 pages in your map? I have modified viewer files because I want to set a themed layer dynamically in each map in the first time that my application to be loaded. My use case is: The theming is placed according to a preference to set by the user in previous session. Thus the applicacion could show two preferences on the same map(and the same layout). This is useful when you want to show comparisons, for example: To compare population 1980 vs 1990 (like a dashboard). Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? Thanks, Ivan Milicevic wrote: Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout 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
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 titleViewer 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%WEBLAYOUT=%=webLayout%THEMINGTYPE=1 frame id=viewer2Frame frameborder=no marginwidth=0 marginheight=0 scrolling=no src=/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT=%=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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Two maps in the same layout
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-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Rodolfo Moreno Sent: Wednesday, January 21, 2009 7:47 AM To: mapguide-users@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 titleViewer 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
RE: [mapguide-users] Two maps in the same layout
Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout 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-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Rodolfo Moreno Sent: Wednesday, January 21, 2009 7:47 AM To: mapguide-users@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 titleViewer 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
RE: [mapguide-users] Two maps in the same layout
Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout 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-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Rodolfo Moreno Sent: Wednesday, January 21, 2009 7:47 AM To: mapguide-users@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
Re: [mapguide-users] Two maps in the same layout
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 -- View this message in context: http://n2.nabble.com/Two-maps-in-the-same-layout-tp2189508p2189542.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users