Re: [mapguide-users] Maintaining MapGuide Session during Restart
Perhaps you can create a package from a Session repo? You will run into two problems if you try to copy from Session to Library, 1) Session repo is not enumerable (a security feature, IMO useless) 2) Runtime Maps cannot be saved into Library. Both problems can be solved by doing a custom build of MapGuide, and removing the checks. I seem to recal that the Session repo can be enumerated by the Administrator. You can't make a 100% xml copy, because the xml has attached resourcesm which are binary files. Regards, Kenneth Skovhede, GEOGRAF A/S bruce_weston skrev: Bruce D, Are you suggesting that this can be done? Does anyone have a script or a method of copying the session repository into a library object? Is there even a way of creating a copy of the session as XML? thanks, Bruce W Bruce Dechant wrote: Bruce, What you are doing by trying to replace the session repository of a running server is problematic and could lead to server instability. You really shouldn't do this. The session repository is meant for temporary runtime data only and not for persistent data. If you want any of your session repository data to survive a restart you need to use the library repository instead. Thanks, Bruce -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of bruce_weston Sent: Wednesday, January 28, 2009 2:34 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Maintaining MapGuide Session during Restart I'm just wondering if anyone has managed to do this yet? This is my attempted MapGuide restart script to keep the contents of the session folder backed up, but it doesn't work: echo MapGuide Scheduler Task Starting taskkill /F /FI SERVICES eq MapGuideServer2.0 net stop MapGuideServer2.0 REM xcopy c:\Progra~1\MapGuideOpenSource2.0\Server\Repositories\Session\* c:\Progra~1\MapGuideOpenSource2.0\SessionBackup\ /E /Y net start MapGuideServer2.0 REM xcopy c:\Progra~1\MapGuideOpenSource2.0\SessionBackup\* c:\Progra~1\MapGuideOpenSource2.0\Server\Repositories\Session\ /E /Y echo MapGuide Scheduler Task Completed pause Is there session data stored anywhere else? I really want to make the process seamless for my users. Bruce -- View this message in context: http://n2.nabble.com/Maintaining-MapGuide-Session-during-Restart-tp2231199p2231199.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 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Custom Search
Yes, but once you have the full Xml, you can load it into an Xml parser. It looks like you are using C#, so the code would be: XmlDocument doc = new XmlDocument(); doc.LoadXml(rd.ToString()); XmlNode node = doc.SelectSingleNode(xs:Filter, namespacemanager); //You need to setup the namespace manager. string filter = node.InnerText; //Here it is If you are using C#, you may want to look at the MaestroAPI: http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI Using the MaestroAPI, you can read the filter like this: ServerConnectionI con; //Read the docs on how to initialize this LayerDefinition ldef = con.GetLayerDefinition(Library:// + myLayer.GetLayerDefinition().GetPath() + / + myLayer.GetName() + .LayerDefinition); VectorLayerDefinition vldef = ldef.Item as VectorLayerDefinition; string filter = vldef.Filter; //Here it is IMO, much easier, and no use of the Mg* classes. Regards, Kenneth Skovhede, GEOGRAF A/S Jamo skrev: Kenneth, Thanks for the response, I am still working on my programming I am unsure on how to read through what I belive is a mgByteReader that the resource retrieves? perhaps I can use the mgLayer.SelectFeatures(mgQueryOptions) however this returns a null exception... :( MgResourceIdentifier myresrc = new MgResourceIdentifier(Library:// + myLayer.GetLayerDefinition().GetPath() + / + myLayer.GetName() + .LayerDefinition); MgByteReader rd = resourceSrvc.GetResourceContent(myresrc); Response.Write(EscapeForHtml(rd.ToString())); This writes out the entire XML File... how can I just return the Filter ? or do I have to do some string work here? ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Creating Packages dynamically
Steps required to create a FeatureSource: MaestroAPI.HttpServerConnection con = new OSGeo.MapGuide.MaestroAPI.HttpServerConnection(new Uri(http://localhost/mapguide;), Administrator, admin, null, true); MaestroAPI.FeatureSource featureSource = con.CreateResourceObjectMaestroAPI.FeatureSource(); set properties on the featureSource object as you like. there is no manual for this, look at an existing featuresource's xml for hints ... con.SaveResourceAs(featureSource, Library://myfeaturesource.FeatureSource); Steps required to create a LayerDefinition: MaestroAPI.HttpServerConnection con = new OSGeo.MapGuide.MaestroAPI.HttpServerConnection(new Uri(http://localhost/mapguide;), Administrator, admin, null, true); MaestroAPI.LayerDefinition layerDefinition = con.CreateResourceObjectMaestroAPI.LayerDefinition(); MaestroAPI.VectorLayerDefinitionType vldef = layerDefinition.Item as MaestroAPI.VectorLayerDefinitionType; set properties on the vldef object as you like. there is no manual for this, look at an existing layerdefinition's xml for hints ... //Attach to featureSource vldef.ResourceId = featureSource.ResourceId; vldef.FeatureName = Schema:Class; //Needs to change according to featuresource con.SaveResourceAs(layerDefinition, Library://mylayer.LayerDefinition); If you prefer not to use the MaestroAPI, you can do the same using raw xml, but you need to know what xml tags are valid where. Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi Kenneth, thanks for u r help. Actually i want a help u told that Restoring a package is quite a big and cumbersome task. If you want to load a layer with oracle data, it is much easier to do so, simply by loading the Xml manually. This can also be done without Administrator credentials. I can offer you no more advice than to look at the avalible code. AFAIK, there is no example code avalible that does exactly what you want, but the code I pointed you to should make it easier to do so. can u plz tell me the step by step procedure exactly for creating feature rsource,layers so that it will be helpful to me for loading oracle data (approximately 10 layers) plz consider this request. Thanks and Regards, Padmini Kenneth Skovhede, GEOGRAF A/S wrote: 0) Seriously, scroll down to the initial response in the mail for a link to the code. 1) You recently posted about the LayerDefinitionFactory, so surely you know how to load xml. Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi Kenneth, Thanks for u r reply. u told for seeing available code. but where is that code i didn't get it. 1)how to load xml manually can u give me an idea so that it will be helpful to me. Thanks and Regards, Padmini Kenneth Skovhede, GEOGRAF A/S wrote: Restoring a package is quite a big and cumbersome task. If you want to load a layer with oracle data, it is much easier to do so, simply by loading the Xml manually. This can also be done without Administrator credentials. I can offer you no more advice than to look at the avalible code. AFAIK, there is no example code avalible that does exactly what you want, but the code I pointed you to should make it easier to do so. Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi Kenneth, Thanks for u r reply. u said that Creating packages is an administrative task, so I won't expect many API users to have a need for it.but i want to load layers from oracle dynamically (i mean to say if i have a,b,c tables in oracle.i ant to load a,b or b,c or a,c layers based on requirement programmetically.so i thought dynamic maestro will support this requirement.) can u plz tell me 1) How can i achieve this requirement dynamically. Thanks and Regards, Padmini. Rodolfo Moreno wrote: thanks Kenneth, It's cool. Kenneth Skovhede, GEOGRAF A/S wrote: Yes, you need at least 1.0.9, but the released version has a bug, with creating packages, so you should get the preview release from the download page: http://trac.osgeo.org/mapguide/wiki/maestro/Downloads The package options are found in the Package menu. Regards, Kenneth Skovhede, GEOGRAF A/S Rodolfo Moreno skrev: Hi, I didn't know that Mapguide Maestro can create mapguide packages. I have 1.0.8.27399 version and I have not found this option. could you tell me how can I achieve this? or maybe I need the last maestro version. Thanks, Kenneth Skovhede, GEOGRAF A/S wrote: Hello Padmini. There are no ready-to-use code in MaestroAPI for authoring (creating) MapGuide Packages. Creating packages is an administrative task, so I won't expect many API users to have a need for it. The Maestro application has code that creates and edits packages. The code can be found here:
[mapguide-users] Thematic Mapping
Hi, iam using mpguide opensource 2.0 (.net 2.0 +IIS 5.1). I want to do thematic mapping for polygon layer(for example parcel layer) i tried to use the code in dotnetviewer sample.its working fine iam able to create a thematic layer with same color to the all polygons. Now my problem is that i want to apply different colours to the different polygons for example for parcel_id =1 green colour for example for parcel_id =2 Red colour and soon. for this can u plz tell me the code for how to do it? my code was as follows -- NameValueCollection serverVars = Request.ServerVariables; String strServerVars = ; foreach (String str in serverVars.AllKeys) { strServerVars += br + str; } String platform = serverVars[SERVER_SOFTWARE]; String queryStr = serverVars[QUERY_STRING]; string queryStr1 = serverVars[Form]; NameValueCollection requestParams = Request.HttpMethod == POST ? Request.Form : Request.QueryString; String sessionId = Request.QueryString[SESSION]; string realPath = Request.ServerVariables[APPL_PHYSICAL_PATH]; String configPath = realPath + webconfig.ini; MapGuideApi.MgInitializeWebTier(configPath); MgUserInformation userInfo = new MgUserInformation(sessionId); MgSiteConnection siteConnection = new MgSiteConnection(); siteConnection.Open(userInfo); MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService); MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService); MgMap map = new MgMap(); map.Open(resourceService, mapdata); MgLayerCollection layers = map.GetLayers(); MgLayer layer = (MgLayer)layers.GetItem(property layer); MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId()); MgResourceIdentifier layerDefResId = layer.GetLayerDefinition(); MgByteReader byteReader = resourceService.GetResourceContent(layerDefResId); // Load the Layer Definition and Navigate to the specified VectorScaleRange XmlDocument doc = new XmlDocument(); String xmlLayerDef = byteReader.ToString(); doc.LoadXml(xmlLayerDef); XmlNodeList nodeList = doc.GetElementsByTagName(VectorScaleRange); XmlElement vectorScaleRangecElement = (XmlElement)nodeList.Item(0); XmlElement areaTypeStyle = (XmlElement)vectorScaleRangecElement.GetElementsByTagName(AreaTypeStyle).Item(0); // Remove any existing AreaRule elements. XmlNodeList areaRuleList = areaTypeStyle.GetElementsByTagName(AreaRule); int count = areaRuleList.Count; for (int i = 0; i count; i++) { //The areaRuleList shrinks as we remove items, so always //remove the first item (don't use the index i) areaTypeStyle.RemoveChild(areaRuleList.Item(0)); } // Now create the new AreaRule elements. String areaRuleTemplate = File.ReadAllText(GetThemeXmlTemplatePath()); MgFeatureAggregateOptions aggregateOptions = new MgFeatureAggregateOptions(); String value = null; String filterText = null; String areaRuleXML = null; XmlDocument areaDoc = null; XmlNode areaNode = null; double portion = 0.0; aggregateOptions.AddFeatureProperty(FeatId); aggregateOptions.SelectDistinct(true); aggregateOptions.SetFilter(totquery); double increment = (5 1) ? 1.0 / (5 - 1) : 1.0; MgDataReader dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions); while (dataReader.ReadNext()) { value = GetFeaturePropertyValue(dataReader, FeatId); filterText = quot; + FeatId + quot; = ; filterText = filterText + value; areaRuleXML = String.Format(areaRuleTemplate, FeatId + : + value, filterText, InterpolateColor(portion, C2C3C4, C2C3C4, 0), InterpolateColor(portion, C2C3C4, C2C3C4, 0)); areaDoc = new XmlDocument(); areaDoc.LoadXml(areaRuleXML); areaDoc.Save(C:\\theme.xml); areaNode = doc.ImportNode(areaDoc.DocumentElement, true); areaTypeStyle.AppendChild(areaNode); portion = portion + increment; } dataReader.Close(); // Now save our new layer definition to the session and add it to the map. String xmlString = doc.DocumentElement.OuterXml; String uniqueName =
[mapguide-users] Help whit MapGuide in Spanish
Hola a todos, hace poco que comence a usar el MapGuide Open Source y tengo alguno problemas y dudas hacerca de la onfiguracion principalmente del servidor. Alguno de ustedes puede darme ayuda en Español. Grcaias a todos ___ 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
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] Maintaining MapGuide Session during Restart
Hmmm. Creating a package from a session may well the be the way forward. I will look at doing this programatically and report back to the board on my progress! thanks for all your help so far people! Ross Kenneth Skovhede, GEOGRAF A/S wrote: Perhaps you can create a package from a Session repo? You will run into two problems if you try to copy from Session to Library, 1) Session repo is not enumerable (a security feature, IMO useless) 2) Runtime Maps cannot be saved into Library. Both problems can be solved by doing a custom build of MapGuide, and removing the checks. I seem to recal that the Session repo can be enumerated by the Administrator. You can't make a 100% xml copy, because the xml has attached resourcesm which are binary files. Regards, Kenneth Skovhede, GEOGRAF A/S bruce_weston skrev: Bruce D, Are you suggesting that this can be done? Does anyone have a script or a method of copying the session repository into a library object? Is there even a way of creating a copy of the session as XML? thanks, Bruce W Bruce Dechant wrote: Bruce, What you are doing by trying to replace the session repository of a running server is problematic and could lead to server instability. You really shouldn't do this. The session repository is meant for temporary runtime data only and not for persistent data. If you want any of your session repository data to survive a restart you need to use the library repository instead. Thanks, Bruce -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of bruce_weston Sent: Wednesday, January 28, 2009 2:34 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Maintaining MapGuide Session during Restart I'm just wondering if anyone has managed to do this yet? This is my attempted MapGuide restart script to keep the contents of the session folder backed up, but it doesn't work: echo MapGuide Scheduler Task Starting taskkill /F /FI SERVICES eq MapGuideServer2.0 net stop MapGuideServer2.0 REM xcopy c:\Progra~1\MapGuideOpenSource2.0\Server\Repositories\Session\* c:\Progra~1\MapGuideOpenSource2.0\SessionBackup\ /E /Y net start MapGuideServer2.0 REM xcopy c:\Progra~1\MapGuideOpenSource2.0\SessionBackup\* c:\Progra~1\MapGuideOpenSource2.0\Server\Repositories\Session\ /E /Y echo MapGuide Scheduler Task Completed pause Is there session data stored anywhere else? I really want to make the process seamless for my users. Bruce -- View this message in context: http://n2.nabble.com/Maintaining-MapGuide-Session-during-Restart-tp2231199p2231199.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 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://n2.nabble.com/Maintaining-MapGuide-Session-during-Restart-tp2231199p2244520.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] invokeurl
Thanks Gordon Paul On 29-Jan-09, at 4:08 PM, GordonL wrote: Done! http://trac.osgeo.org/mapguide/ticket/832 regards gordon Andy Morsell wrote: Gordon, Please be sure to submit this as a bug to the Fusion project Trac. Andy Morsell, P.E. Spatial Integrators, Inc. www.SpatialGIS.com -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of GordonL Sent: Thursday, January 29, 2009 12:26 PM To: mapguide-users@lists.osgeo.org Subject: Re: [mapguide-users] invokeurl Hi Andrew, ok I figured it out. It is the InvokeURL.js file. This file is found in the following folder: \www\fusion\widgets Here is the issue: At line 40 it shows: Fusion.Widget.InvokeURL.prototype = { sFeatures : 'menubar=no,location=no,resizable=yes,status=no,scrollbars=yes', Which is fine. I changed resizable=yes and added scrollbars=yes...so far so good... But, at line 120, it reads: window.open(url, this.sTarget, this.sWinFeatures); Ok, so the issue is that there is NO sWinFeatures... I changed it to read: window.open(url, this.sTarget, this.sFeatures); And voilà! I am in business...whew. I thought I was losing my touch. gordon Andrew DeMerchant wrote: It wasn't part of the widget - i've been away from Fusion for too long now, and really can't recall. I would imagine it was in the .js file for that widget...sorry I'm no more help than that! On 1/29/2009 11:44 AM, GordonL wrote: Hi Andrew, I am having trouble finding the entry in Nabble. Do you have an example? I am sure I did this a couple of years ago, but I can't find it. Can it be part of the Widget XML in Studio too? thanks gordon Andrew DeMerchant wrote: I did...I also turned on the scrollbars - but I can't recall how at the momentdo a search on Nabble, and you should find the answer. Andrew GordonL wrote: Did you figure this out with Flexible Web Layouts? This fix works great for Simple Web Layouts but how do we turn on Scrolling/Toolbars in the InvokeURL for Fusion? Is it part of the InvokeURL.js file in the /fusion/wigets/ folder? thanks gordon Andrew DeMerchant wrote: Is there a way to modify the InvokeURL command to have it open a window with scrollbars and toolbars? Right now, if you tell it to open in a new window, that window never has scrollbars or toolbars. I need to turn those on somehow. I've looked through the AJAX viewer php files, but can't find the spot that I'd change. Andrew -- *Andrew DeMerchant* *Computer Technologist* ph.1-877-2GEMTEC x.163 fax 506-453-9470 /GEMTEC Limitedhttp://www.gemtec.ca /191 Doak Road Fredericton, NB, Canada E3C 2E6 ___ 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 -- *Andrew DeMerchant* *Computer Technologist* ph.1-877-2GEMTEC x.163 fax 506-453-9470 /GEMTEC Limited http://www.gemtec.ca /191 Doak Road Fredericton, NB, Canada E3C 2E6 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://n2.nabble.com/invokeurl-tp1816596p2241087.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 -- View this message in context: http://n2.nabble.com/invokeurl-tp1816596p2241282.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] Fusion and Digitizing
Thanks guys ... the digitizing code has changed in the upcoming 2.0 release to use the OpenLayers vector library rather than our home- grown canvas implementation so we'll make sure there is a way to clean up after digitizing ... Mike, can you take a skim through this thread and make sure the new Vector implementation has a method for cleaning up, or implicitly cleans up if possible. Cheers Paul On 29-Jan-09, at 6:14 PM, Mark Pendergraft wrote: thanks! I'll take a look at it later tonight. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Rodolfo Moreno Sent: Thursday, January 29, 2009 3:02 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Fusion and Digitizing Hi Mark, I have gotten to clear the digitized polygons in FUSION viewer by modifying the MapGuideViewerapi.js var polDigitizer; function DigitizePolygon(handler) { if (handler) { var Fusion = window.top.Fusion; var mapWidget = Fusion.getWidgetById(mapWidgetId); var digitizer = new Fusion.Tool.Canvas.Polygon(mapWidget); digitizer.mouseDown = MultiPointHandlers.prototype.mouseDown; digitizer.mouseMove = MultiPointHandlers.prototype.mouseMove; digitizer.dblClick = MultiPointHandlers.prototype.dblClick; Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []); digitizer.handler = handler; digitizer.activateCanvas(); polDigitizer = digitizer; //add a listener to update the position of the features var mapWidget = Fusion.getWidgetById(mapWidgetId); mapWidget.registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED, extendEvtResponse ); } } function extendEvtResponse(){ var digitizer = polDigitizer; digitizer.updatePx(); digitizer.clearContext(); digitizer.draw(digitizer.context); } function clearPol(){ polDigitizer.clearContext(); var Fusion = window.top.Fusion; var mapWidget = Fusion.getWidgetById(mapWidgetId); mapWidget.deregisterForEvent(Fusion.Event.MAP_EXTENTS_CHANGED, extendEvtResponse); polDigitizer.deactivateCanvas(); } In your main page you must call to clearPol() function in order to clear the digitized polygon. For the other shapes I guess that the logic is the same. The above code only clears the last polygon digitized. It's necessary to manage an array of digitizers for controlling all digitized polygons. I haven't had time for trying it. I have tested with mapguide 2.0.1 with FUSION 1.0.6 in IE7 and FF2 maybe you can improve it. Regards, GordonL wrote: Hi Mark, I know what you mean about the sticky digitizing... I was told to look at the resetCanvas function in the Measure.js file to get rid of that leftover digitize graphics...but I haven't tried it yet... gordon Mark Pendergraft wrote: I was in no way implying the wheel should be reinvented, in fact the code I posted was an example of how to use the MapGuideViewerAPI.js supplied DigitizePolygon(handler) function that you referred to. I did say that I would like to see some method to clear the digitized shapes after the function's handler has been called. In MGOS 1.2 after a polygon was digitized, it was destroyed. In MGOS 2 with Fusion 1.1, the polygon stays on the map until the user closes their browser. -Mark P. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of GordonL Sent: Thursday, January 29, 2009 1:20 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Fusion and Digitizing You know, you really do not need to reinvent the wheel, if you have already built a lot of code with the Basic Web Layouts. Did you know that Fusion supports some retro digitizing methods? For example, I put the following in an INVOKESCRIPT in the Flexible Web Layout: top.parent.DigitizePoint(top.OnPointDigitized); I also have the OnPointDigitized in a JS file attached to the main frame/window. So I reuse my code for both FUSION and Basic Web Layouts... Just check out the functions in the MapGuideViewerApi.js in the /www/fusion/MapGuide/ folder... They include: Refresh() SetSelectionXML(selectionXml) ZoomToView(x, y, scale, refresh) DigitizePoint(handler) DigitizeLine(handler) DigitizeLineString(handler) DigitizeRectangle(handler) DigitizePolygon(handler) They work just like the classic MapGuide Viewer API...pretty sweet. gordon Mark Pendergraft wrote: Absolutely. My biggest beef with digitizing in Fusion is that when you digitize an object (point/polygon/etc.) it stays on the map. The existing functions don't have a clear method to remove the digitized object, and my programming skills aren't good enough that I want to mess with it. It's very simple, Add a reference to MapGuideViewerApi.js and call DigitizePolygon() The DigitizePolygon function requires that you pass it a handler Something similar to the following:
[mapguide-users] Filtering layers in php application
Hi, I want to customize different applications from the phpviewersample like Theme layer and Query. In fact, my layout includes an important quantity of layers and these two applications are not pertinent for all the layers (and features). So, is it possible to limit the layers (features) visible for these applications? Moreover, is it also possible to specify a map layer group? Thanks. Arnaud De Groof ___ E-MAIL DISCLAIMER The present message may contain confidential and/or legally privileged information. If you are not the intended addressee and in case of a transmission error, please notify the sender immediately and destroy this E-mail. Disclosure, reproduction or distribution of this document and its possible attachments is strictly forbidden. SPACEBEL denies all liability for incomplete, improper, inaccurate, intercepted, (partly) destroyed, lost and/or belated transmission of the current information given that unencrypted electronic transmission cannot currently be guaranteed to be secure or error free. Upon request or in conformity with formal, contractual agreements, an originally signed hard copy will be sent to you to confirm the information contained in this E-mail. SPACEBEL denies all liability where E-mail is used for private use. SPACEBEL cannot be held responsible for possible viruses that might corrupt this message and/or your computer system. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Fusion and Digitizing
Even better news! Any word on when the 2.0 beta will be available? -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Paul Spencer Sent: Friday, January 30, 2009 4:16 AM To: MapGuide Users Mail List Cc: Mike Adair Subject: Re: [mapguide-users] Fusion and Digitizing Thanks guys ... the digitizing code has changed in the upcoming 2.0 release to use the OpenLayers vector library rather than our home- grown canvas implementation so we'll make sure there is a way to clean up after digitizing ... Mike, can you take a skim through this thread and make sure the new Vector implementation has a method for cleaning up, or implicitly cleans up if possible. Cheers Paul On 29-Jan-09, at 6:14 PM, Mark Pendergraft wrote: thanks! I'll take a look at it later tonight. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Rodolfo Moreno Sent: Thursday, January 29, 2009 3:02 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Fusion and Digitizing Hi Mark, I have gotten to clear the digitized polygons in FUSION viewer by modifying the MapGuideViewerapi.js var polDigitizer; function DigitizePolygon(handler) { if (handler) { var Fusion = window.top.Fusion; var mapWidget = Fusion.getWidgetById(mapWidgetId); var digitizer = new Fusion.Tool.Canvas.Polygon(mapWidget); digitizer.mouseDown = MultiPointHandlers.prototype.mouseDown; digitizer.mouseMove = MultiPointHandlers.prototype.mouseMove; digitizer.dblClick = MultiPointHandlers.prototype.dblClick; Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []); digitizer.handler = handler; digitizer.activateCanvas(); polDigitizer = digitizer; //add a listener to update the position of the features var mapWidget = Fusion.getWidgetById(mapWidgetId); mapWidget.registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED, extendEvtResponse ); } } function extendEvtResponse(){ var digitizer = polDigitizer; digitizer.updatePx(); digitizer.clearContext(); digitizer.draw(digitizer.context); } function clearPol(){ polDigitizer.clearContext(); var Fusion = window.top.Fusion; var mapWidget = Fusion.getWidgetById(mapWidgetId); mapWidget.deregisterForEvent(Fusion.Event.MAP_EXTENTS_CHANGED, extendEvtResponse); polDigitizer.deactivateCanvas(); } In your main page you must call to clearPol() function in order to clear the digitized polygon. For the other shapes I guess that the logic is the same. The above code only clears the last polygon digitized. It's necessary to manage an array of digitizers for controlling all digitized polygons. I haven't had time for trying it. I have tested with mapguide 2.0.1 with FUSION 1.0.6 in IE7 and FF2 maybe you can improve it. Regards, GordonL wrote: Hi Mark, I know what you mean about the sticky digitizing... I was told to look at the resetCanvas function in the Measure.js file to get rid of that leftover digitize graphics...but I haven't tried it yet... gordon Mark Pendergraft wrote: I was in no way implying the wheel should be reinvented, in fact the code I posted was an example of how to use the MapGuideViewerAPI.js supplied DigitizePolygon(handler) function that you referred to. I did say that I would like to see some method to clear the digitized shapes after the function's handler has been called. In MGOS 1.2 after a polygon was digitized, it was destroyed. In MGOS 2 with Fusion 1.1, the polygon stays on the map until the user closes their browser. -Mark P. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of GordonL Sent: Thursday, January 29, 2009 1:20 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Fusion and Digitizing You know, you really do not need to reinvent the wheel, if you have already built a lot of code with the Basic Web Layouts. Did you know that Fusion supports some retro digitizing methods? For example, I put the following in an INVOKESCRIPT in the Flexible Web Layout: top.parent.DigitizePoint(top.OnPointDigitized); I also have the OnPointDigitized in a JS file attached to the main frame/window. So I reuse my code for both FUSION and Basic Web Layouts... Just check out the functions in the MapGuideViewerApi.js in the /www/fusion/MapGuide/ folder... They include: Refresh() SetSelectionXML(selectionXml) ZoomToView(x, y, scale, refresh) DigitizePoint(handler) DigitizeLine(handler) DigitizeLineString(handler) DigitizeRectangle(handler) DigitizePolygon(handler) They work just like the classic MapGuide Viewer API...pretty sweet. gordon Mark Pendergraft wrote: Absolutely. My biggest beef with digitizing in
[mapguide-users] RE: Filtering layers in php application
In the web tier API, the MgMap object has a GetLayerGroups() method that should allow you to determine the list of layer groups. Building a UI for selecting a group would probably be very similar to the existing layer filter. MgLayer has a GetGroup() method that would allow you to determine if a given layer is in the group that you want. From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Arnaud De Groof Sent: Friday, January 30, 2009 6:00 AM To: MapGuide Users Mail List Subject: [mapguide-users] Filtering layers in php application Hi, I want to customize different applications from the phpviewersample like Theme layer and Query. In fact, my layout includes an important quantity of layers and these two applications are not pertinent for all the layers (and features). So, is it possible to limit the layers (features) visible for these applications? Moreover, is it also possible to specify a map layer group? Thanks. Arnaud De Groof E-MAIL DISCLAIMER The present message may contain confidential and/or legally privileged information. If you are not the intended addressee and in case of a transmission error, please notify the sender immediately and destroy this E-mail. Disclosure, reproduction or distribution of this document and its possible attachments is strictly forbidden. SPACEBEL denies all liability for incomplete, improper, inaccurate, intercepted, (partly) destroyed, lost and/or belated transmission of the current information given that unencrypted electronic transmission cannot currently be guaranteed to be secure or error free. Upon request or in conformity with formal, contractual agreements, an originally signed hard copy will be sent to you to confirm the information contained in this E-mail. SPACEBEL denies all liability where E-mail is used for private use. SPACEBEL cannot be held responsible for possible viruses that might corrupt this message and/or your computer system. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
[mapguide-users] Select Within
Hey all; It seems randomnly that my Select-Within no longer works. I can no longer draw a rectangle in select mode and select all within that rectangle. Has this happened to anyone? This is kind of urgent. Any help is much appreciated. -- View this message in context: http://n2.nabble.com/Select-Within-tp2245937p2245937.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] Help whit MapGuide in Spanish
Hola Marcelo, Yo no soy un experto, estoy utilizando MapGuide Open Source para hacer el Proyecto Final de Carrera desde hace unos meses. Si estás utilizando la versión MapGuide 2.0.1 y de FDO la 3.0.1 en Windows (a partir del código fuente, con apache como servidor y php como lenguaje) a lo mejor te puedo echar una mano. Un saludo. Date: Fri, 30 Jan 2009 09:20:15 -0200From: marcelo.jaureguibe...@gmail.comto: mapguide-us...@lists.osgeo.orgsubject: [mapguide-users] Help whit MapGuide in Spanish Hola a todos, hace poco que comence a usar el MapGuide Open Source y tengo alguno problemas y dudas hacerca de la onfiguracion principalmente del servidor. Alguno de ustedes puede darme ayuda en Español. Grcaias a todos _ Consigue gratis el nuevo Messenger. ¡Descárgatelo! http://download.live.com/___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Fusion and Digitizing
An alpha of MGOS 2.1 (including Fusion 2.0 beta) is supposed to be ready by end of month, but I'm going to have a couple really late nights if I'm going to make that :) Paul, correct me if I'm wrong, but I think that Fusion 2.0 will run against MGOS 2.0, though some of the performance enhancements may be 2.1-specific with 2.0 fallbacks. All templates will need to be rewritten though because of considerable changes to the Jx library and the Fusion underpinnings. Jason -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: January-30-09 8:28 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Fusion and Digitizing Even better news! Any word on when the 2.0 beta will be available? -Mark ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Thematic Mapping
I would recommend modifying your call to InterpolateColor() so that the start color and end color correspond to the colors you want. They are currently both set to the same string. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of padmini godavarthi Sent: Friday, January 30, 2009 3:59 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Thematic Mapping Hi, iam using mpguide opensource 2.0 (.net 2.0 +IIS 5.1). I want to do thematic mapping for polygon layer(for example parcel layer) i tried to use the code in dotnetviewer sample.its working fine iam able to create a thematic layer with same color to the all polygons. Now my problem is that i want to apply different colours to the different polygons for example for parcel_id =1 green colour for example for parcel_id =2 Red colour and soon. for this can u plz tell me the code for how to do it? my code was as follows -- NameValueCollection serverVars = Request.ServerVariables; String strServerVars = ; foreach (String str in serverVars.AllKeys) { strServerVars += br + str; } String platform = serverVars[SERVER_SOFTWARE]; String queryStr = serverVars[QUERY_STRING]; string queryStr1 = serverVars[Form]; NameValueCollection requestParams = Request.HttpMethod == POST ? Request.Form : Request.QueryString; String sessionId = Request.QueryString[SESSION]; string realPath = Request.ServerVariables[APPL_PHYSICAL_PATH]; String configPath = realPath + webconfig.ini; MapGuideApi.MgInitializeWebTier(configPath); MgUserInformation userInfo = new MgUserInformation(sessionId); MgSiteConnection siteConnection = new MgSiteConnection(); siteConnection.Open(userInfo); MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService); MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService); MgMap map = new MgMap(); map.Open(resourceService, mapdata); MgLayerCollection layers = map.GetLayers(); MgLayer layer = (MgLayer)layers.GetItem(property layer); MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId()); MgResourceIdentifier layerDefResId = layer.GetLayerDefinition(); MgByteReader byteReader = resourceService.GetResourceContent(layerDefResId); // Load the Layer Definition and Navigate to the specified VectorScaleRange XmlDocument doc = new XmlDocument(); String xmlLayerDef = byteReader.ToString(); doc.LoadXml(xmlLayerDef); XmlNodeList nodeList = doc.GetElementsByTagName(VectorScaleRange); XmlElement vectorScaleRangecElement = (XmlElement)nodeList.Item(0); XmlElement areaTypeStyle = (XmlElement)vectorScaleRangecElement.GetElementsByTagName(AreaTypeStyle).Item(0); // Remove any existing AreaRule elements. XmlNodeList areaRuleList = areaTypeStyle.GetElementsByTagName(AreaRule); int count = areaRuleList.Count; for (int i = 0; i count; i++) { //The areaRuleList shrinks as we remove items, so always //remove the first item (don't use the index i) areaTypeStyle.RemoveChild(areaRuleList.Item(0)); } // Now create the new AreaRule elements. String areaRuleTemplate = File.ReadAllText(GetThemeXmlTemplatePath()); MgFeatureAggregateOptions aggregateOptions = new MgFeatureAggregateOptions(); String value = null; String filterText = null; String areaRuleXML = null; XmlDocument areaDoc = null; XmlNode areaNode = null; double portion = 0.0; aggregateOptions.AddFeatureProperty(FeatId); aggregateOptions.SelectDistinct(true); aggregateOptions.SetFilter(totquery); double increment = (5 1) ? 1.0 / (5 - 1) : 1.0; MgDataReader dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions); while (dataReader.ReadNext()) { value = GetFeaturePropertyValue(dataReader, FeatId); filterText = quot; + FeatId + quot; = ; filterText = filterText + value; areaRuleXML = String.Format(areaRuleTemplate, FeatId + : + value, filterText, InterpolateColor(portion, C2C3C4, C2C3C4, 0), InterpolateColor(portion, C2C3C4, C2C3C4, 0)); areaDoc = new XmlDocument(); areaDoc.LoadXml(areaRuleXML);
[mapguide-users] SQL 2008, MGOS 2.0.2, FDO 3.3.x - 3.4.x, Maestro 1.0.9 do not cooperate
Hello, I am newbe in this area and I am trying to marry SQL 2008 with MGOS. I used this topic to do transfer from SHP to SQL http://www.longhorncorner.com/UploadFile/nschan/Shapefiles04112007005648AM/Shapefiles.aspx Last Friday everything was fine and I was able to see my data on the map. Then something happens :-) and I wasn't able to see data from SQL on the map anymore. To eliminate environment-related issues I started from scratch and installed new MGOS 2.0.2 server and the story begins... The way I was changing FDO was stop MapGuide Server service, delete everything from C:\Program Files\MapGuideOpenSource2.0\Server\Bin\FDO and replace it with files from fdosdk-win32-3.3.1\Bin or fdosdk-win32-3.3.2\Bin and so on. So I was using Windows SDK files. Using FDO 3.4.0.Beta1 through FDO 3.3.2 allows me to create DataSource, which points to my SQL Server database, but gives me Failed to read schema from data source. The operation gave the error message: Bad document when I am trying to choose Feature Source while creating layer in MapGuide Maestro (both v1.0.9 and r3558). Out of the box. Using FDO 3.3.1 allows me to create DataSource and Layer, but shows no data on the map even though I know that there is data in the table and I can see it on the Spatial Results tab in the SQL. I check that my Initial Map View set to the right values. Next step for me would be to try installing Autodesk MapGuide Studio trial and using FDO SQL 2008 spatial provider from there... But before I would do so I have a question. Is there checklist of components/requirements defined and tested for MGOS - SQL 2008 integration? Like 1. PK in the table has to be int/bigint/... 2. Geometry column has to have a clustered index 3. FDO has to be version ... 4. Maestro ... Any help would be greatly appreciated. Thank you! -- View this message in context: http://n2.nabble.com/SQL-2008%2C-MGOS-2.0.2%2C-FDO-3.3.x---3.4.x%2C-Maestro-1.0.9-do-not-cooperate-tp2247138p2247138.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: RE: [mapguide-users] Postgis/mapguide
Hi there, I've found many of the posting regarding connecting PostGIS and MGOS extremely useful. I have managed to create a datasource, point it to the PostGIS database, and no errors are reported when testing the connection. GREAT! However... Now, I am trying to create a map that will allow me to display my postGIS data. I have created a new layer in MGOS Web Studio and pointed the layer to my postGIS datasource (as suggested in step 5-6). At this point, Step 7 Select the table to use, I am not able to select any tables. I am attempting to select a feature source from the drop down list, but it is empty. Should my PostGIS tables show up at this point? Any feedback regarding displaying PostGIS data after establishing a connection would be greatly appreciated! TMerz 1. Create a datasource How does one create a datasource using WebStudio or can some please post a working example of a datasource. On 13/09/2007, Kenneth, GEOGRAF A/S k...@geograf.dk wrote: If you are able to connect to the datasource, there should be no problem displaying it. These are the steps to follow: 1. Create a datasource 2. Point it to the PostGIS database 3. Click Test connection 4. When it works, save the datasource. 5. Create a new layer 6. Point the layer to the datasource. 7. Select the table to use. 8. Style the point, line and area to your pleasing. 9. Save the layer. 10. Create a mapdefinition. 11. Select the correct projection for the data. 12. Add the layer to the map, make sure you have Layer is initially visble in the map checked. 13. Save the map. 14. Create a new WebLayout. 15. Select the map. 16. Save the WebLayout. After item 7, you should be able to preview your data, using the Preview feature. Item 8 is where you could set up filters and the like. You can repeat item 12, if you have many layers. If the above does not help, try to explain where it goes wrong. Regards, Kenneth, GEOGRAF A/S -- View this message in context: http://n2.nabble.com/Postgis-mapguide-tp1812261p2247155.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
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
[mapguide-users] Mapguide OpenSource and DWF files
Hello, I am a new user of Mapguide and had a question about how to display a .dwf file using jsp in Mapguide. Based on the sample: String webLayout = Library://Samples/Sheboygan/Layouts/SheboyganJsp.WebLayout; frame src=../mapviewerjava/dwfviewer.jsp?SESSION=%= sessionId %WEBLAYOUT=%= webLayout % name=ViewerFrame If I have test.dwf, I wanted to find out how to display the file in the browser using dwfviewer. I have seen links like: http://n2.nabble.com/Displaying-DWF-Files-td1815210.html#a1815210 http://www.mail-archive.com/mapguide-users@lists.osgeo.org/msg05049.html I am not clear if I need mapguide studio to convert dwf file to web layout or if I can just copy the .dwf file and use it as a paramater. I am a beginner and our company is looking into different options of displaying .dwf files in a browser and highlight various objects in the dwf based on the search criteria. Any help would be greatly appreciated. Thanks, Rithika -- View this message in context: http://n2.nabble.com/Mapguide-OpenSource-and-DWF-files-tp2247625p2247625.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: RE: [mapguide-users] Postgis/mapguide
Try using Maestro or MapGuide Studio, Web studio is more a proof of concept and has issues probably should be removed from the distribution IHMO z On Sat, Jan 31, 2009 at 8:22 AM, tmerz trishm...@gmail.com wrote: Hi there, I've found many of the posting regarding connecting PostGIS and MGOS extremely useful. I have managed to create a datasource, point it to the PostGIS database, and no errors are reported when testing the connection. GREAT! However... Now, I am trying to create a map that will allow me to display my postGIS data. I have created a new layer in MGOS Web Studio and pointed the layer to my postGIS datasource (as suggested in step 5-6). At this point, Step 7 Select the table to use, I am not able to select any tables. I am attempting to select a feature source from the drop down list, but it is empty. Should my PostGIS tables show up at this point? Any feedback regarding displaying PostGIS data after establishing a connection would be greatly appreciated! TMerz 1. Create a datasource How does one create a datasource using WebStudio or can some please post a working example of a datasource. On 13/09/2007, Kenneth, GEOGRAF A/S k...@geograf.dk wrote: If you are able to connect to the datasource, there should be no problem displaying it. These are the steps to follow: 1. Create a datasource 2. Point it to the PostGIS database 3. Click Test connection 4. When it works, save the datasource. 5. Create a new layer 6. Point the layer to the datasource. 7. Select the table to use. 8. Style the point, line and area to your pleasing. 9. Save the layer. 10. Create a mapdefinition. 11. Select the correct projection for the data. 12. Add the layer to the map, make sure you have Layer is initially visble in the map checked. 13. Save the map. 14. Create a new WebLayout. 15. Select the map. 16. Save the WebLayout. After item 7, you should be able to preview your data, using the Preview feature. Item 8 is where you could set up filters and the like. You can repeat item 12, if you have many layers. If the above does not help, try to explain where it goes wrong. Regards, Kenneth, GEOGRAF A/S -- View this message in context: http://n2.nabble.com/Postgis-mapguide-tp1812261p2247155.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 -- Zac Spitzer - http://zacster.blogspot.com +61 405 847 168 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users