[mapguide-users] Example for drawing line from point to point ....?
Has anyone got any examples of shortest route, ie finding the neareast end point of a line network then highlighting the next one that is on route to the destination, basically like whereis or something? or has anyone got any idaes on how to code it? I will be able to create the line network it won't be too complicated. It's for a floor plan of a building. Cheers -- View this message in context: http://www.nabble.com/Example-for-drawing-line-from-point-to-point---tp20807144p20807144.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] Geomap GIS Publishing
hai all.. Anyone used Geomap GIS Publishing?? How do it on Mapguide Open Source?? plz teach me how?? thanx -- View this message in context: http://www.nabble.com/Geomap-GIS-Publishing-tp20804421p20804421.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] Overview Map on geomapgis
May be Ya.. So .. How i wanna make overview map in ajaxviewer? Then How i wanna create *.mwf ?? -- View this message in context: http://www.nabble.com/Overview-Map-on-geomapgis-tp20765927p20804384.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] Uploading Shapefile to Map for Immediate DisplayProblem
Hey Kevin, I checked out your site. I am working on very similar functionality. My users need to be able to ADD, DELETE, and EDIT (stylize) layers. I used the Maestro API to implement the ADD functionality. See one of my previous messages for the code snippet here: http://www.nabble.com/DWGLoadProcedure-td20016401.html I also made a layerdefinition factory to create the XML necessary for creating the .LayerDefintion. For the layer to show up immediately, after the save, you need to invoke the Refresh() method from the viewerFrame. I haven't had any luck calling this method from a ASP user control yet. :( -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of kevin_t Sent: Tuesday, December 02, 2008 1:06 PM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Uploading Shapefile to Map for Immediate DisplayProblem I like to set it up so that people can upload shapefiles from their computer to my mapguide map and have it immediately add it as a layer to my map and show up on screen immediately. Does anybody know how to implement this functionality? Or know where to download one that works? I have inherited customization in PHP code that does this but it's not working and I am unable to fix it. The map is located at: http://204.244.79.12/mapguide2009/uploadshp/canada_frameset.php Under Tasks on the right > Upload Shapefile Any help or suggestions will be greatly appreciated. -- View this message in context: http://n2.nabble.com/Uploading-Shapefile-to-Map-for-Immediate-Display-Pr oblem-tp1605726p1605726.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 Notice Regarding Confidentiality This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged. Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email. If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited. Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Uploading Shapefile to Map for Immediate DisplayProblem
We've attacked this problem here a little differently. The idea was to set up a location (per data custodian) to overwrite a previously set up and configured SHP file for web publication. Basically we go to the trouble of setting up things ahead of time for stylization and symbology and once that's in place, the data custodian updates the data by simply replacing the SHP file for publishing. Pushing any old layer up to the server has some disadvantages (in our system) with regard to integrating the new data with the existing data stores. There is also a learning curve associated with the initial stylization steps to some degree. However, I'm still interested in the approach you describe, and how to set up an environment to manage (to some degree) the publishing process that still allows the data custodian as much freedom as possible to get their business tasks streamlined. bobb >>> kevin_t <[EMAIL PROTECTED]> 12/02/08 2:06 PM >>> I like to set it up so that people can upload shapefiles from their computer to my mapguide map and have it immediately add it as a layer to my map and show up on screen immediately. Does anybody know how to implement this functionality? Or know where to download one that works? I have inherited customization in PHP code that does this but it's not working and I am unable to fix it. The map is located at: http://204.244.79.12/mapguide2009/uploadshp/canada_frameset.php Under Tasks on the right > Upload Shapefile Any help or suggestions will be greatly appreciated. -- View this message in context: http://n2.nabble.com/Uploading-Shapefile-to-Map-for-Immediate-Display-Problem-tp1605726p1605726.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] Uploading Shapefile to Map for Immediate Display Problem
I like to set it up so that people can upload shapefiles from their computer to my mapguide map and have it immediately add it as a layer to my map and show up on screen immediately. Does anybody know how to implement this functionality? Or know where to download one that works? I have inherited customization in PHP code that does this but it's not working and I am unable to fix it. The map is located at: http://204.244.79.12/mapguide2009/uploadshp/canada_frameset.php Under Tasks on the right > Upload Shapefile Any help or suggestions will be greatly appreciated. -- View this message in context: http://n2.nabble.com/Uploading-Shapefile-to-Map-for-Immediate-Display-Problem-tp1605726p1605726.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] XML Parser error for Feature Sources
pguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20 787959.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 Notice Regarding Confidentiality This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged. Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email. If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited. Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users __ Information from ESET NOD32 Antivirus, version of virus signature database 3658 (20081202) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.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] XML Parser error for Feature Sources
gt;>>> You can try to create the UTF-8 encoder with: >>>>> >>>>> UTF8Encoding utf8 = new UTF8Encoding(false); >>>>> >>>>> >>>>> And see if the problem goes away. >>>>> Alternatively you can use the MaestroAPI instead of messing with the >>>>> raw >>>>> Xml: >>>>> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI >>>>> >>>>> Regards, Kenneth Skovhede, GEOGRAF A/S >>>>> >>>>> >>>>> >>>>> >>> ___ >>> 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://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20 787959.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 Notice Regarding Confidentiality This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged. Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email. If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited. Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users __ Information from ESET NOD32 Antivirus, version of virus signature database 3658 (20081202) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Runtime map problem
Administrator", "admin", >> "en", True) >> >> 'You have to change the string below to point at a valid WebLayout >> >> Dim weblayout as WebLayout = >> con.GetWebLayout("Library://mylayout.WebLayout") >> Dim mapdefinition as MapDefinition = >> con.GetMapDefinition(weblayout.Map.ResourceId) >> weblayout.Map.InitialView = new MapViewType() >> weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 >> weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - >> mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX >> weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - >> mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY Dim tempid >> as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), >> OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) >> Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & >> Server.UrlEncode(tempid) & "&USERNAME=Anonymous&PASSWORD=") >> >> >> Regards, Kenneth Skovhede, GEOGRAF A/S >> >> >> padmini godavarthi skrev: >>> Hi, >>> Thanks for u r reply >>> >>> actually i wrote the code as >>> >>> >>> Dim host As New >>> Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) >>> Dim conn As New HttpServerConnection(host, "Administrator", >>> "admin", "en", True) >>> Dim res As New ResourceIdentifier("Filebased >>> data/Maps/mapdata", >>> ResourceTypes.MapDefinition) >>> Dim mapId As String = res.ResourceId >>> >>> >>> with that i got the map resource id. >>> >>> But actually to run the application the url in the browser must be >>> like >>> >>> >>> http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library%3a%2f%2fF >>> ilebased+data%2fLayout%2flayout.WebLayout >>> >>> 1) How can i get this weblayout (like >>> Library%3a%2f%2fFilebased+data%2fLayout%2flayout.WebLayout) >>> programmetically >>> >>> 2) I want to redirect to the ajax viewer sample application through >>> asp.net (like given by u ) >>> >>> Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=...resourceId >>> for >>> your WebLayout...&USERNAME=Anonymous&PASSWORD="); >>> >>> 3) Can u plz tell me the purpose of runtime map (actualli iam in >>> configusing >>> state) >>> >>> >>> >>> >>> >>> Kenneth Skovhede, GEOGRAF A/S wrote: >>> >>>> Instead of re-posting the original question, could you try to >>>> explain what parts of my previous reply that are unclear or wrong? >>>> >>>> http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-to20 >>>> 704038.html#a20769349 >>>> >>>> Regards, Kenneth Skovhede, GEOGRAF A/S >>>> >>>> >>>> >>>> padmini godavarthi skrev: >>>> >>>>> Hi , >>>>> iam using mapguide open source 2.0( with .Net 2.0 + IIS 5.1) Iam >>>>> using dotnet viewer sample while running the application i >>>>> observed that the layout path given in the application. >>>>> >>>>> as >>>>> >>>>> String webLayout = >>>>> "Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout"; >>>>> >>>>> it works but now i want to create this weblayout in run time (by >>>>> code) >>>>> using mapguide maestro api >>>>> >>>>> for this purpose i followed the link >>>>> >>>>> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/Run >>>>> timeMap >>>>> >>>>> but i didnt get any out. >>>>> >>>>> can u plz tell me >>>>> >>>>> 1) how to create this weblayout in run time >>>>> 2) How it will works >>>>> >>>>> If u know this plz tell me the procedure. >>>>> >>>>> >>>>> Regards, >>>>> Padmini. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> ___ >>>> 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://www.nabble.com/Runtime-map-problem-tp20789983p20793385.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 __ Information from ESET NOD32 Antivirus, version of virus signature database 3658 (20081202) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] XML Parser error for Feature Sources
I have now added a small note on the page hinting the solution. Regards, Kenneth Skovhede, GEOGRAF A/S Greenhough, Jamie skrev: Thanks for the tip about Maestro chm file. I had the same problems until I 'Unblocked' the file just now.! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of cagray Sent: Tuesday, December 02, 2008 1:29 AM To: mapguide-users@lists.osgeo.org Subject: Re: [mapguide-users] XML Parser error for Feature Sources Thats works great. I had written a web app which allows a user to completely customise the appearances of layers. Behind the scenes it just edits the xml but I suspect the MaestroAPI could do this all for me without me touching the xml. I need to look into it more as I need to be able to save to both session and library and always show the updates on a live map however the MaestroAPI looks ideal. The help chm file, I can download fine but when I do, any links I try and open just come up with 'The address is not valid'. However turns out this is an intended security feature of IE. Basically to fix it all you have to do is right click on the chm file, go to properties and then click Unblock and it works. (Just in case anyone else has had the same issue) Thanks for all your help! Colin Kenneth Skovhede, GEOGRAF A/S wrote: You have to initialize the parameter collection manually: fs.Parameter = new MaestroAPI.NameValuePairTypeCollection(); (I forgot to mention that). I just tried to download MaestroAPI.chm, and the link works for me: http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Do cumentation/Msdn-Chm/MaestroAPI.chm?format=raw Regards, Kenneth Skovhede, GEOGRAF A/S cagray skrev: I tried your example and I always get an error of: Object reference not set to an instance of an object. when I do: fs.Parameter["DefaultFilePath"] = "C:\my.shp"; or other similar attempts for other providers. If I take this line out it creates the resource no problem. Do you know why this would happen? Also I tried to download the help (MaestroAPI.chm) off the website but none of the help links work. Have I done something daft? Any help is appreciated. Colin Kenneth Skovhede, GEOGRAF A/S wrote: Yes, you can do just that. Look in the Maestro source code to see how it's done. The files "ResourceEditors/ResourceEditorBase.cs" and "ResourceEditors/ResourceEditorGeneric.cs" shows it. Some more customized versions are avalible in eg "FeatureSourceEditorSDF.cs" Basically you can do: MaestroAPI.ServerConnectionI con; //You must initialize this, see the developer docs MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource(); fs.Provider = "OSGeo.SHP.3.1"; fs.Parameter["DefaultFilePath"] = "C:\my.shp"; con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier("my fs", OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource)); As for your actual problem, does the server error log show anything? C:\program files\Mapguideopensource2.0\server\logs\error.log Regards, Kenneth Skovhede, GEOGRAF A/S cagray skrev: Thanks for the reply. Unfortunately that did not solve my problem and I got the same error. Is there anything else I could try? I was not aware you could do this without generating/manipulating the xml. My web tool has to fully control setting up data sources. So the user selects a provider and then fills in the connection details. I then need to create a new data source from this to be stored in mapguide. Can you do this using the Meastro API alone? Kenneth Skovhede, GEOGRAF A/S wrote: I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM, which causes problems in the Xml parser: http://trac.osgeo.org/mapguide/ticket/233 You can try to create the UTF-8 encoder with: UTF8Encoding utf8 = new UTF8Encoding(false); And see if the problem goes away. Alternatively you can use the MaestroAPI instead of messing with the raw Xml: http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI Regards, Kenneth Skovhede, GEOGRAF A/S ___ 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] XML Parser error for Feature Sources
Thanks for the tip about Maestro chm file. I had the same problems until I 'Unblocked' the file just now.! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of cagray Sent: Tuesday, December 02, 2008 1:29 AM To: mapguide-users@lists.osgeo.org Subject: Re: [mapguide-users] XML Parser error for Feature Sources Thats works great. I had written a web app which allows a user to completely customise the appearances of layers. Behind the scenes it just edits the xml but I suspect the MaestroAPI could do this all for me without me touching the xml. I need to look into it more as I need to be able to save to both session and library and always show the updates on a live map however the MaestroAPI looks ideal. The help chm file, I can download fine but when I do, any links I try and open just come up with 'The address is not valid'. However turns out this is an intended security feature of IE. Basically to fix it all you have to do is right click on the chm file, go to properties and then click Unblock and it works. (Just in case anyone else has had the same issue) Thanks for all your help! Colin Kenneth Skovhede, GEOGRAF A/S wrote: > > You have to initialize the parameter collection manually: > fs.Parameter = new MaestroAPI.NameValuePairTypeCollection(); > (I forgot to mention that). > > I just tried to download MaestroAPI.chm, and the link works for me: > http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Do cumentation/Msdn-Chm/MaestroAPI.chm?format=raw > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > cagray skrev: >> I tried your example and I always get an error of: >> >> Object reference not set to an instance of an object. >> >> when I do: >> >> fs.Parameter["DefaultFilePath"] = "C:\my.shp"; >> >> or other similar attempts for other providers. If I take this line out it >> creates the resource no problem. Do you know why this would happen? >> >> Also I tried to download the help (MaestroAPI.chm) off the website but >> none >> of the help links work. Have I done something daft? >> >> Any help is appreciated. >> Colin >> >> >> Kenneth Skovhede, GEOGRAF A/S wrote: >> >>> Yes, you can do just that. >>> Look in the Maestro source code to see how it's done. >>> The files "ResourceEditors/ResourceEditorBase.cs" and >>> "ResourceEditors/ResourceEditorGeneric.cs" shows it. >>> Some more customized versions are avalible in eg >>> "FeatureSourceEditorSDF.cs" >>> >>> Basically you can do: >>> MaestroAPI.ServerConnectionI con; //You must initialize this, see >>> the developer docs >>> MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource(); >>> fs.Provider = "OSGeo.SHP.3.1"; >>> fs.Parameter["DefaultFilePath"] = "C:\my.shp"; >>> con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier("my fs", >>> OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource)); >>> >>> >>> As for your actual problem, does the server error log show anything? >>> C:\program files\Mapguideopensource2.0\server\logs\error.log >>> >>> Regards, Kenneth Skovhede, GEOGRAF A/S >>> >>> >>> >>> cagray skrev: >>> Thanks for the reply. Unfortunately that did not solve my problem and I got the same error. Is there anything else I could try? I was not aware you could do this without generating/manipulating the xml. My web tool has to fully control setting up data sources. So the user selects a provider and then fills in the connection details. I then need to create a new data source from this to be stored in mapguide. Can you do this using the Meastro API alone? Kenneth Skovhede, GEOGRAF A/S wrote: > I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM, > which causes problems in the Xml parser: > http://trac.osgeo.org/mapguide/ticket/233 > > You can try to create the UTF-8 encoder with: > > UTF8Encoding utf8 = new UTF8Encoding(false); > > > And see if the problem goes away. > Alternatively you can use the MaestroAPI instead of messing with the > raw > Xml: > http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > >>> ___ >>> 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://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20 787959.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osg
Re: [mapguide-users] Runtime map problem
Its a function that creates a GUID (Globally Unique ID). It creates a string like "xcsdfasd-sdfasdf-dsdfasf" but ensures that it is mathematically certain that you will not get duplicates, even if you call it multiple times on multiple machines. For the example I sent, you can replace it with any string, like: "session map test". Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi, Thanku very much for ur help i tried this code but i got an error in the line Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) because of this Guid.NewGuid() 1) Actually what is this? 2) Which paramater we have to pass in this place instead of Guid.NewGuid() Regards, Padmini Kenneth Skovhede, GEOGRAF A/S wrote: I forgot to save the weblayout in the code below :( Updated version is: 'Setup connection Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) 'You have to change the string below to point at a valid WebLayout Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim mapdefinition as MapDefinition = con.GetMapDefinition(weblayout.Map.ResourceId) 'Modify the initial view of the weblayout weblayout.Map.InitialView = new MapViewType() weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY 'Obtain a unique session based id for the temporary weblayout (which is a copy of an existing WebLayout) Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) 'Save the layout, otherwise you can't reference it con.SaveResourceAs(weblayout, tempid) 'Open the viewer, and use the temporary layout, since the map only exists in the 'current session, we must use that session, and NOT supply username/password 'BEWARE: The session belongs to the Administrator account, so the user gets full access to MapGuide (delete, modify, etc.) Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & Server.UrlEncode(tempid) & "&SESSION=" & Server.UrlEncode(con.SessionID)) Regards, Kenneth Skovhede, GEOGRAF A/S Kenneth Skovhede, GEOGRAF A/S skrev: To build a map, you must have all the components: 1. FeatureSource, references data 2. LayerDefinition, references a FeatureSource 3. MapDefinition, references multiple LayerDefinitions 4. WebLayout, references a MapDefinition All these items must be in a repository (either Library or Session), otherwise they can't be referenced. When you write that you want to "create a WebLayout programatically", do you want to create ALL the above items, or do you have layers and featuresources? (1) If you want to generate a WebLayout ResourceID, you should use: Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", ResourceTypes.WebLayout) If you want to read the name of an existing MapDefinition from another layout, you must do: Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim res as String = webLayout.Map.ResourceId (2) I don't understand the question. (3) The MapDefinition is an Xml document. Inside, it references layers, which references featuresources, as described above. It is very slow to do this, so when you open a map in the browser, the xml is transformed into a binary object. This object contains all the info from the MapDefinition and some info from the layers and featuresources. You need to know this, because if you try to toggle layer visibility in the MapDefinition, nothing happens. In short, the Runtime Map is a binary object that you can manipulate using the MapGuide (and Maestro)-API, and it only works for a displayed map. Upon startup, the Runtime Map is identical to the MapDefinition it was created from. A short example of using an existing WebLayout: Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) 'You have to change the string below to point at a valid WebLayout Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim mapdefinition as MapDefinition = con.GetMapDefinition(weblayout.Map.ResourceId) weblayout.Map.InitialView = new MapViewType() weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid
Re: [mapguide-users] Runtime map problem
Hi, Thanku very much for ur help i tried this code but i got an error in the line Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) because of this Guid.NewGuid() 1) Actually what is this? 2) Which paramater we have to pass in this place instead of Guid.NewGuid() Regards, Padmini Kenneth Skovhede, GEOGRAF A/S wrote: > > I forgot to save the weblayout in the code below :( > > Updated version is: > > 'Setup connection > Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) > Dim conn As New HttpServerConnection(host, "Administrator", "admin", > "en", True) > > 'You have to change the string below to point at a valid WebLayout > Dim weblayout as WebLayout = > con.GetWebLayout("Library://mylayout.WebLayout") > Dim mapdefinition as MapDefinition = > con.GetMapDefinition(weblayout.Map.ResourceId) > > 'Modify the initial view of the weblayout > weblayout.Map.InitialView = new MapViewType() > weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 > weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - > mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX > weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - > mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY > > 'Obtain a unique session based id for the temporary weblayout (which is > a copy of an existing WebLayout) > Dim tempid as ResourceIdentifier = new > ResourceIdentifier(Guid.NewGuid(), > OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) > > 'Save the layout, otherwise you can't reference it > con.SaveResourceAs(weblayout, tempid) > > 'Open the viewer, and use the temporary layout, since the map only > exists in the > 'current session, we must use that session, and NOT supply > username/password > 'BEWARE: The session belongs to the Administrator account, so the user > gets full access to MapGuide (delete, modify, etc.) > Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & > Server.UrlEncode(tempid) & "&SESSION=" & Server.UrlEncode(con.SessionID)) > > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > Kenneth Skovhede, GEOGRAF A/S skrev: >> To build a map, you must have all the components: >> 1. FeatureSource, references data >> 2. LayerDefinition, references a FeatureSource >> 3. MapDefinition, references multiple LayerDefinitions >> 4. WebLayout, references a MapDefinition >> >> All these items must be in a repository (either Library or Session), >> otherwise they can't be referenced. >> >> When you write that you want to "create a WebLayout programatically", >> do you want to create ALL the above items, or do you have layers and >> featuresources? >> >> (1) If you want to generate a WebLayout ResourceID, you should use: >> Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", >> ResourceTypes.WebLayout) >> If you want to read the name of an existing MapDefinition from another >> layout, you must do: >> Dim weblayout as WebLayout = >> con.GetWebLayout("Library://mylayout.WebLayout") >> Dim res as String = webLayout.Map.ResourceId >> >> (2) I don't understand the question. >> >> (3) The MapDefinition is an Xml document. Inside, it references layers, >> which references featuresources, as described above. It is very slow to >> do this, so when you open a map in the browser, the xml is transformed >> into >> a binary object. This object contains all the info from the >> MapDefinition and >> some info from the layers and featuresources. >> >> You need to know this, because if you try to toggle layer visibility >> in the MapDefinition, >> nothing happens. In short, the Runtime Map is a binary object that you >> can manipulate >> using the MapGuide (and Maestro)-API, and it only works for a >> displayed map. >> Upon startup, the Runtime Map is identical to the MapDefinition it was >> created from. >> >> >> A short example of using an existing WebLayout: >> >> Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) >> Dim conn As New HttpServerConnection(host, "Administrator", "admin", >> "en", True) >> >> 'You have to change the string below to point at a valid WebLayout >> >> Dim weblayout as WebLayout = >> con.GetWebLayout("Library://mylayout.WebLayout") >> Dim mapdefinition as MapDefinition = >> con.GetMapDefinition(weblayout.Map.ResourceId) >> weblayout.Map.InitialView = new MapViewType() >> weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 >> weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - >> mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX >> weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - >> mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY >> Dim tempid as ResourceIdentifier = new >> ResourceIdentifier(Guid.NewGuid(), >> OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) >> Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & >> Server.UrlEn
[mapguide-users] MG Studio 2009 and OraKing provider 8.5 crashing mgserver
Howdy, >From the Event log: Faulting application mgserver.exe, version 2.0.2.3011, faulting module KingOracleProvider.dll, version 0.8.5.0, fault address 0x0005c079. >From the Error.log: StackTrace: - MgMappingUtil.StylizeLayers line 786 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\mapping\MappingUtil.cpp Failed to stylize layer: VIEW_LANDAREALEASES An unclassified exception occurred. <2008-12-02T08:12:27> Fusion Viewer 10.14.12.190Administrator Error: Failed to stylize layer: SPCALEASE_test An unclassified exception occurred. I have no idea what the above is but I sure do get my share!!! StackTrace: - MgMappingUtil.StylizeLayers line 786 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\mapping\MappingUtil.cpp Failed to stylize layer: SPCALEASE_test An unclassified exception occurred. <2008-12-02T08:12:51> Fusion Viewer 10.14.12.190Administrator Error: An exception occurred in FDO component. Item GISMIA~FCLTY3099_3~GEOMETRY is already in this named collection. StackTrace: - MgFeatureServiceHandler.ProcessOperation line 83 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\FeatureServiceHandler.cpp - MgOpGetIdentityProperties.Execute line 113 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\OpGetIdentityProperties.cpp - MgServerDescribeSchema.GetIdentityProperties line 1715 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\ServerDescribeSchema.cpp - MgServerDescribeSchema.ExecuteDescribeSchema line 176 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\ServerDescribeSchema.cpp An exception occurred in FDO component. Item GISMIA~FCLTY3099_3~GEOMETRY is already in this named collection. Is the problem with MG Studio 2009 or with sl-king 8.5? r, dennis -- View this message in context: http://www.nabble.com/MG-Studio-2009-and-OraKing-provider-8.5-crashing-mgserver-tp20792186p20792186.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] Permanent changes in data
I just bumped that bug to critical after some reflection as that is a serious potential dataloss bug IMHO On Tue, Dec 2, 2008 at 8:08 AM, Kenneth Skovhede, GEOGRAF A/S <[EMAIL PROTECTED]> wrote: > You could be affected by this bug: > http://trac.osgeo.org/mapguide/ticket/649 > > Otherwise, try to post a section of the code, > maybe someone will spot something obvious. > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > Stefan Dalakov skrev: >> >> Hi all, >> I am trying to add a feature (permanently) to a data source. >> I am using MGOS 1.2 and tried Sheboygan samples, where this part is not >> working, I have not explored the reason yet. >> My idea is to digitize a feature ( a line ) and add it permanently to an >> existing layer on the map. >> I wrote some code, and everything seems OK, no errors, but at the end I >> have no feature added. >> Can someone help with a piece of code ? >> >> Thanks in advance >> Stefan Dalakov >> ___ >> 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 > -- 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
Re: [mapguide-users] Runtime map problem
I forgot to save the weblayout in the code below :( Updated version is: 'Setup connection Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) 'You have to change the string below to point at a valid WebLayout Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim mapdefinition as MapDefinition = con.GetMapDefinition(weblayout.Map.ResourceId) 'Modify the initial view of the weblayout weblayout.Map.InitialView = new MapViewType() weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY 'Obtain a unique session based id for the temporary weblayout (which is a copy of an existing WebLayout) Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) 'Save the layout, otherwise you can't reference it con.SaveResourceAs(weblayout, tempid) 'Open the viewer, and use the temporary layout, since the map only exists in the 'current session, we must use that session, and NOT supply username/password 'BEWARE: The session belongs to the Administrator account, so the user gets full access to MapGuide (delete, modify, etc.) Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & Server.UrlEncode(tempid) & "&SESSION=" & Server.UrlEncode(con.SessionID)) Regards, Kenneth Skovhede, GEOGRAF A/S Kenneth Skovhede, GEOGRAF A/S skrev: To build a map, you must have all the components: 1. FeatureSource, references data 2. LayerDefinition, references a FeatureSource 3. MapDefinition, references multiple LayerDefinitions 4. WebLayout, references a MapDefinition All these items must be in a repository (either Library or Session), otherwise they can't be referenced. When you write that you want to "create a WebLayout programatically", do you want to create ALL the above items, or do you have layers and featuresources? (1) If you want to generate a WebLayout ResourceID, you should use: Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", ResourceTypes.WebLayout) If you want to read the name of an existing MapDefinition from another layout, you must do: Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim res as String = webLayout.Map.ResourceId (2) I don't understand the question. (3) The MapDefinition is an Xml document. Inside, it references layers, which references featuresources, as described above. It is very slow to do this, so when you open a map in the browser, the xml is transformed into a binary object. This object contains all the info from the MapDefinition and some info from the layers and featuresources. You need to know this, because if you try to toggle layer visibility in the MapDefinition, nothing happens. In short, the Runtime Map is a binary object that you can manipulate using the MapGuide (and Maestro)-API, and it only works for a displayed map. Upon startup, the Runtime Map is identical to the MapDefinition it was created from. A short example of using an existing WebLayout: Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) 'You have to change the string below to point at a valid WebLayout Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim mapdefinition as MapDefinition = con.GetMapDefinition(weblayout.Map.ResourceId) weblayout.Map.InitialView = new MapViewType() weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & Server.UrlEncode(tempid) & "&USERNAME=Anonymous&PASSWORD=") Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi, Thanks for u r reply actually i wrote the code as Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", ResourceTypes.MapDefinition) Dim mapId As String = res.ResourceId with that i got the map resource id. But actually to run the application the url in the browser must be like http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library%3a%2f%2fFilebased+d
Re: [mapguide-users] Runtime map problem
To build a map, you must have all the components: 1. FeatureSource, references data 2. LayerDefinition, references a FeatureSource 3. MapDefinition, references multiple LayerDefinitions 4. WebLayout, references a MapDefinition All these items must be in a repository (either Library or Session), otherwise they can't be referenced. When you write that you want to "create a WebLayout programatically", do you want to create ALL the above items, or do you have layers and featuresources? (1) If you want to generate a WebLayout ResourceID, you should use: Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", ResourceTypes.WebLayout) If you want to read the name of an existing MapDefinition from another layout, you must do: Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim res as String = webLayout.Map.ResourceId (2) I don't understand the question. (3) The MapDefinition is an Xml document. Inside, it references layers, which references featuresources, as described above. It is very slow to do this, so when you open a map in the browser, the xml is transformed into a binary object. This object contains all the info from the MapDefinition and some info from the layers and featuresources. You need to know this, because if you try to toggle layer visibility in the MapDefinition, nothing happens. In short, the Runtime Map is a binary object that you can manipulate using the MapGuide (and Maestro)-API, and it only works for a displayed map. Upon startup, the Runtime Map is identical to the MapDefinition it was created from. A short example of using an existing WebLayout: Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) 'You have to change the string below to point at a valid WebLayout Dim weblayout as WebLayout = con.GetWebLayout("Library://mylayout.WebLayout") Dim mapdefinition as MapDefinition = con.GetMapDefinition(weblayout.Map.ResourceId) weblayout.Map.InitialView = new MapViewType() weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000 weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY - mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY Dim tempid as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(), OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID) Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" & Server.UrlEncode(tempid) & "&USERNAME=Anonymous&PASSWORD=") Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi, Thanks for u r reply actually i wrote the code as Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", ResourceTypes.MapDefinition) Dim mapId As String = res.ResourceId with that i got the map resource id. But actually to run the application the url in the browser must be like http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library%3a%2f%2fFilebased+data%2fLayout%2flayout.WebLayout 1) How can i get this weblayout (like Library%3a%2f%2fFilebased+data%2fLayout%2flayout.WebLayout) programmetically 2) I want to redirect to the ajax viewer sample application through asp.net (like given by u ) Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=...resourceId for your WebLayout...&USERNAME=Anonymous&PASSWORD="); 3) Can u plz tell me the purpose of runtime map (actualli iam in configusing state) Kenneth Skovhede, GEOGRAF A/S wrote: Instead of re-posting the original question, could you try to explain what parts of my previous reply that are unclear or wrong? http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-to20704038.html#a20769349 Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi , iam using mapguide open source 2.0( with .Net 2.0 + IIS 5.1) Iam using dotnet viewer sample while running the application i observed that the layout path given in the application. as String webLayout = "Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout"; it works but now i want to create this weblayout in run time (by code) using mapguide maestro api for this purpose i followed the link http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/RuntimeMap but i didnt get any out. can u plz tell me 1) how to create this weblayout in run time 2) How it will works If u know this plz tell me the procedure. Regards, Padmini. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mai
Re: [mapguide-users] Permanent changes in data - Solved
I solved it. The problem was that MG Studio shows that the ID field is of type "Double". In the DBF file (as this is a shp Feature source) the ID field is declared as N,11,0 So I substituted *MgDoubleProperty *with* **MgInt32Property* and it works now. Stefan Dalakov Kenneth Skovhede, GEOGRAF A/S wrote: Could it be that "ID" is the primary key, and if you insert two features with ID 11, it breaks? Or that the ID is auto-assigned, and thus not assignable from MapGuide/FDO? btw, things tend to work better with MapGuide if your primary key is an integer. Regards, Kenneth Skovhede, GEOGRAF A/S Stefan Dalakov skrev: It is something stupid, but I cannot spot it... Everything works if I omit the bold part of the code : function MakeLine($name, $x0, $y0 , $x1, $y1) { $propertyCollection = new MgPropertyCollection(); *$cntr = (double) 11.0 ; $idProperty = new MgDoubleProperty("ID",$cntr); $propertyCollection->Add($idProperty); *$owner = "Aaa" ; $ownerProperty = new MgStringProperty("Owner", $owner); $propertyCollection->Add($ownerProperty); $nameProperty = new MgStringProperty("Purpose", $name); $propertyCollection->Add($nameProperty); $wktReaderWriter = new MgWktReaderWriter(); $agfReaderWriter = new MgAgfReaderWriter(); $agftext = "LINESTRING XY ($x0 $y0, $x1 $y1)" ; $geometry = $wktReaderWriter->Read( $agftext); $geometryByteReader = $agfReaderWriter->Write($geometry); $geometryProperty = new MgGeometryProperty("Geometry", $geometryByteReader); $propertyCollection->Add($geometryProperty); return $propertyCollection; } MG Studio says this property is Double Stefan Dalakov Kenneth Skovhede, GEOGRAF A/S wrote: You could be affected by this bug: http://trac.osgeo.org/mapguide/ticket/649 Otherwise, try to post a section of the code, maybe someone will spot something obvious. Regards, Kenneth Skovhede, GEOGRAF A/S Stefan Dalakov skrev: Hi all, I am trying to add a feature (permanently) to a data source. I am using MGOS 1.2 and tried Sheboygan samples, where this part is not working, I have not explored the reason yet. My idea is to digitize a feature ( a line ) and add it permanently to an existing layer on the map. I wrote some code, and everything seems OK, no errors, but at the end I have no feature added. Can someone help with a piece of code ? Thanks in advance Stefan Dalakov ___ 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 ___ 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] Runtime map problem
Hi, Thanks for u r reply actually i wrote the code as Dim host As New Uri("http://localhost/mapguide/mapagent/mapagent.fcgi";) Dim conn As New HttpServerConnection(host, "Administrator", "admin", "en", True) Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata", ResourceTypes.MapDefinition) Dim mapId As String = res.ResourceId with that i got the map resource id. But actually to run the application the url in the browser must be like http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library%3a%2f%2fFilebased+data%2fLayout%2flayout.WebLayout 1) How can i get this weblayout (like Library%3a%2f%2fFilebased+data%2fLayout%2flayout.WebLayout) programmetically 2) I want to redirect to the ajax viewer sample application through asp.net (like given by u ) Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=...resourceId for your WebLayout...&USERNAME=Anonymous&PASSWORD="); 3) Can u plz tell me the purpose of runtime map (actualli iam in configusing state) Kenneth Skovhede, GEOGRAF A/S wrote: > > Instead of re-posting the original question, > could you try to explain what parts of my previous reply > that are unclear or wrong? > > http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-to20704038.html#a20769349 > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > padmini godavarthi skrev: >> Hi , >> iam using mapguide open source 2.0( with .Net 2.0 + IIS 5.1) >> Iam using dotnet viewer sample while running the application i observed >> that >> the layout path given in the application. >> >> as >> >> String webLayout = >> "Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout"; >> >> it works but now i want to create this weblayout in run time (by code) >> using mapguide maestro api >> >> for this purpose i followed the link >> >> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/RuntimeMap >> >> but i didnt get any out. >> >> can u plz tell me >> >> 1) how to create this weblayout in run time >> 2) How it will works >> >> If u know this plz tell me the procedure. >> >> >> Regards, >> Padmini. >> >> >> >> >> >> >> > ___ > mapguide-users mailing list > mapguide-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide-users > > -- View this message in context: http://www.nabble.com/Runtime-map-problem-tp20789983p20790458.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] Runtime map problem
Instead of re-posting the original question, could you try to explain what parts of my previous reply that are unclear or wrong? http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-to20704038.html#a20769349 Regards, Kenneth Skovhede, GEOGRAF A/S padmini godavarthi skrev: Hi , iam using mapguide open source 2.0( with .Net 2.0 + IIS 5.1) Iam using dotnet viewer sample while running the application i observed that the layout path given in the application. as String webLayout = "Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout"; it works but now i want to create this weblayout in run time (by code) using mapguide maestro api for this purpose i followed the link http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/RuntimeMap but i didnt get any out. can u plz tell me 1) how to create this weblayout in run time 2) How it will works If u know this plz tell me the procedure. Regards, Padmini. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Patch to change the active tool Cursor in ajax viewer
I agree that this would be nice to have as a default. There exists an implementation here: http://trac.osgeo.org/mapguide/wiki/CodeSamples/JavaScript/CustomCursors Could you update that one to better match your implementation? The easiest way to get this into the next release, is to make it in "unified diff" format. On windows, you can use the TortoiseSVN tool for this. Just check out the trunk of MapGuide (or possibly only the web stuff) with TortoiseSVN. Then modify the files required, and add the cursor files with TortoiseSVN. Once you are happy with the changes, right click the topmost folder, and select "TortoiseSVN" -> "Create Patch". Then create a trac ticket, and attach the patch file. You must also sign a contributor agreement form. It sounds like a lot of work, but once done, it is easy to contribute more later. Feel free to ask for further info on any of the steps above. Regards, Kenneth Skovhede, GEOGRAF A/S Bruno Scott skrev: Here is a small patch to make the map cursor reflect the active toolbar action. function UpdateMapActionCursor(action) { var strCursor = "auto"; switch(action) { case 1: /*pan*/strCursor = "url('../stdicons/icon_pan.cur'), pointer";break; case 9: /*Zoom window*/strCursor = "url('../stdicons/icon_zoomrect.cur'), pointer";break; case 7: /*Zoom plus*/ strCursor = "url('../stdicons/icon_zoomin.cur'), pointer";break; case 8: /*Zoom minus*/ strCursor = "url('../stdicons/icon_zoomout.cur'), pointer";break; } document.getElementById("tbMap").style.cursor = strCursor; } function ExecuteMapAction(action) { if(!mapInit) return; CancelDigitization(); UpdateMapActionCursor(action); switch(action) { ... it has been tested on IE7,FF3.04 and Chrome It would be great if this piece of code was in the Mapguide core. It's possible for a custom applications to override the ExecuteMapAction, but i think this is usefull for all Mapguide users. And as the ExecuteMapAction function is not an official API, it could change in future release, and this make it difficult to maintain. If you want to test it in Mapguide 2.02 , i've included in attachement the complete ajaxmappane.templ and the cursor file itself. Don't forget to make a backup of the existing templ file... Just replace the existing www/viewerfiles/ajaxmappane.templ and copy the cursor file in the www/stdicons directory. http://www.nabble.com/file/p20789750/MapguideCursor.zip MapguideCursor.zip ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
[mapguide-users] Runtime map problem
Hi , iam using mapguide open source 2.0( with .Net 2.0 + IIS 5.1) Iam using dotnet viewer sample while running the application i observed that the layout path given in the application. as String webLayout = "Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout"; it works but now i want to create this weblayout in run time (by code) using mapguide maestro api for this purpose i followed the link http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/RuntimeMap but i didnt get any out. can u plz tell me 1) how to create this weblayout in run time 2) How it will works If u know this plz tell me the procedure. Regards, Padmini. -- View this message in context: http://www.nabble.com/Runtime-map-problem-tp20789983p20789983.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] Patch to change the active tool Cursor in ajax viewer
Here is a small patch to make the map cursor reflect the active toolbar action. function UpdateMapActionCursor(action) { var strCursor = "auto"; switch(action) { case 1: /*pan*/strCursor = "url('../stdicons/icon_pan.cur'), pointer";break; case 9: /*Zoom window*/strCursor = "url('../stdicons/icon_zoomrect.cur'), pointer";break; case 7: /*Zoom plus*/ strCursor = "url('../stdicons/icon_zoomin.cur'), pointer";break; case 8: /*Zoom minus*/ strCursor = "url('../stdicons/icon_zoomout.cur'), pointer";break; } document.getElementById("tbMap").style.cursor = strCursor; } function ExecuteMapAction(action) { if(!mapInit) return; CancelDigitization(); UpdateMapActionCursor(action); switch(action) { ... it has been tested on IE7,FF3.04 and Chrome It would be great if this piece of code was in the Mapguide core. It's possible for a custom applications to override the ExecuteMapAction, but i think this is usefull for all Mapguide users. And as the ExecuteMapAction function is not an official API, it could change in future release, and this make it difficult to maintain. If you want to test it in Mapguide 2.02 , i've included in attachement the complete ajaxmappane.templ and the cursor file itself. Don't forget to make a backup of the existing templ file... Just replace the existing www/viewerfiles/ajaxmappane.templ and copy the cursor file in the www/stdicons directory. http://www.nabble.com/file/p20789750/MapguideCursor.zip MapguideCursor.zip -- View this message in context: http://www.nabble.com/Patch-to-change-the-active-tool-Cursor-in-ajax-viewer-tp20789750p20789750.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] Permanent changes in data
Could it be that "ID" is the primary key, and if you insert two features with ID 11, it breaks? Or that the ID is auto-assigned, and thus not assignable from MapGuide/FDO? btw, things tend to work better with MapGuide if your primary key is an integer. Regards, Kenneth Skovhede, GEOGRAF A/S Stefan Dalakov skrev: It is something stupid, but I cannot spot it... Everything works if I omit the bold part of the code : function MakeLine($name, $x0, $y0 , $x1, $y1) { $propertyCollection = new MgPropertyCollection(); *$cntr = (double) 11.0 ; $idProperty = new MgDoubleProperty("ID",$cntr); $propertyCollection->Add($idProperty); *$owner = "Aaa" ; $ownerProperty = new MgStringProperty("Owner", $owner); $propertyCollection->Add($ownerProperty); $nameProperty = new MgStringProperty("Purpose", $name); $propertyCollection->Add($nameProperty); $wktReaderWriter = new MgWktReaderWriter(); $agfReaderWriter = new MgAgfReaderWriter(); $agftext = "LINESTRING XY ($x0 $y0, $x1 $y1)" ; $geometry = $wktReaderWriter->Read( $agftext); $geometryByteReader = $agfReaderWriter->Write($geometry); $geometryProperty = new MgGeometryProperty("Geometry", $geometryByteReader); $propertyCollection->Add($geometryProperty); return $propertyCollection; } MG Studio says this property is Double Stefan Dalakov Kenneth Skovhede, GEOGRAF A/S wrote: You could be affected by this bug: http://trac.osgeo.org/mapguide/ticket/649 Otherwise, try to post a section of the code, maybe someone will spot something obvious. Regards, Kenneth Skovhede, GEOGRAF A/S Stefan Dalakov skrev: Hi all, I am trying to add a feature (permanently) to a data source. I am using MGOS 1.2 and tried Sheboygan samples, where this part is not working, I have not explored the reason yet. My idea is to digitize a feature ( a line ) and add it permanently to an existing layer on the map. I wrote some code, and everything seems OK, no errors, but at the end I have no feature added. Can someone help with a piece of code ? Thanks in advance Stefan Dalakov ___ 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 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] XML Parser error for Feature Sources
You can save to either repository, depending on what resourceIdentifier you give. The class ResourceIdentifier can help you construct/manipulate a ResourceIdentifier, if you find it annoying to work with strings. As for the "live map", you will likely need to be aware of the difference between the Runtime Map and the MapDefinition, as stated on the developer docs page under Maestro. Regards, Kenneth Skovhede, GEOGRAF A/S cagray skrev: Thats works great. I had written a web app which allows a user to completely customise the appearances of layers. Behind the scenes it just edits the xml but I suspect the MaestroAPI could do this all for me without me touching the xml. I need to look into it more as I need to be able to save to both session and library and always show the updates on a live map however the MaestroAPI looks ideal. The help chm file, I can download fine but when I do, any links I try and open just come up with 'The address is not valid'. However turns out this is an intended security feature of IE. Basically to fix it all you have to do is right click on the chm file, go to properties and then click Unblock and it works. (Just in case anyone else has had the same issue) Thanks for all your help! Colin Kenneth Skovhede, GEOGRAF A/S wrote: You have to initialize the parameter collection manually: fs.Parameter = new MaestroAPI.NameValuePairTypeCollection(); (I forgot to mention that). I just tried to download MaestroAPI.chm, and the link works for me: http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Documentation/Msdn-Chm/MaestroAPI.chm?format=raw Regards, Kenneth Skovhede, GEOGRAF A/S cagray skrev: I tried your example and I always get an error of: Object reference not set to an instance of an object. when I do: fs.Parameter["DefaultFilePath"] = "C:\my.shp"; or other similar attempts for other providers. If I take this line out it creates the resource no problem. Do you know why this would happen? Also I tried to download the help (MaestroAPI.chm) off the website but none of the help links work. Have I done something daft? Any help is appreciated. Colin Kenneth Skovhede, GEOGRAF A/S wrote: Yes, you can do just that. Look in the Maestro source code to see how it's done. The files "ResourceEditors/ResourceEditorBase.cs" and "ResourceEditors/ResourceEditorGeneric.cs" shows it. Some more customized versions are avalible in eg "FeatureSourceEditorSDF.cs" Basically you can do: MaestroAPI.ServerConnectionI con; //You must initialize this, see the developer docs MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource(); fs.Provider = "OSGeo.SHP.3.1"; fs.Parameter["DefaultFilePath"] = "C:\my.shp"; con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier("my fs", OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource)); As for your actual problem, does the server error log show anything? C:\program files\Mapguideopensource2.0\server\logs\error.log Regards, Kenneth Skovhede, GEOGRAF A/S cagray skrev: Thanks for the reply. Unfortunately that did not solve my problem and I got the same error. Is there anything else I could try? I was not aware you could do this without generating/manipulating the xml. My web tool has to fully control setting up data sources. So the user selects a provider and then fills in the connection details. I then need to create a new data source from this to be stored in mapguide. Can you do this using the Meastro API alone? Kenneth Skovhede, GEOGRAF A/S wrote: I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM, which causes problems in the Xml parser: http://trac.osgeo.org/mapguide/ticket/233 You can try to create the UTF-8 encoder with: UTF8Encoding utf8 = new UTF8Encoding(false); And see if the problem goes away. Alternatively you can use the MaestroAPI instead of messing with the raw Xml: http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI Regards, Kenneth Skovhede, GEOGRAF A/S ___ 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] XML Parser error for Feature Sources
Thats works great. I had written a web app which allows a user to completely customise the appearances of layers. Behind the scenes it just edits the xml but I suspect the MaestroAPI could do this all for me without me touching the xml. I need to look into it more as I need to be able to save to both session and library and always show the updates on a live map however the MaestroAPI looks ideal. The help chm file, I can download fine but when I do, any links I try and open just come up with 'The address is not valid'. However turns out this is an intended security feature of IE. Basically to fix it all you have to do is right click on the chm file, go to properties and then click Unblock and it works. (Just in case anyone else has had the same issue) Thanks for all your help! Colin Kenneth Skovhede, GEOGRAF A/S wrote: > > You have to initialize the parameter collection manually: > fs.Parameter = new MaestroAPI.NameValuePairTypeCollection(); > (I forgot to mention that). > > I just tried to download MaestroAPI.chm, and the link works for me: > http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Documentation/Msdn-Chm/MaestroAPI.chm?format=raw > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > cagray skrev: >> I tried your example and I always get an error of: >> >> Object reference not set to an instance of an object. >> >> when I do: >> >> fs.Parameter["DefaultFilePath"] = "C:\my.shp"; >> >> or other similar attempts for other providers. If I take this line out it >> creates the resource no problem. Do you know why this would happen? >> >> Also I tried to download the help (MaestroAPI.chm) off the website but >> none >> of the help links work. Have I done something daft? >> >> Any help is appreciated. >> Colin >> >> >> Kenneth Skovhede, GEOGRAF A/S wrote: >> >>> Yes, you can do just that. >>> Look in the Maestro source code to see how it's done. >>> The files "ResourceEditors/ResourceEditorBase.cs" and >>> "ResourceEditors/ResourceEditorGeneric.cs" shows it. >>> Some more customized versions are avalible in eg >>> "FeatureSourceEditorSDF.cs" >>> >>> Basically you can do: >>> MaestroAPI.ServerConnectionI con; //You must initialize this, see >>> the developer docs >>> MaestroAPI.FeatureSource fs = new MaestroAPI.FeatureSource(); >>> fs.Provider = "OSGeo.SHP.3.1"; >>> fs.Parameter["DefaultFilePath"] = "C:\my.shp"; >>> con.SaveResourceAs(fs, new MaestroAPI.ResourceIdentifier("my fs", >>> OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource)); >>> >>> >>> As for your actual problem, does the server error log show anything? >>> C:\program files\Mapguideopensource2.0\server\logs\error.log >>> >>> Regards, Kenneth Skovhede, GEOGRAF A/S >>> >>> >>> >>> cagray skrev: >>> Thanks for the reply. Unfortunately that did not solve my problem and I got the same error. Is there anything else I could try? I was not aware you could do this without generating/manipulating the xml. My web tool has to fully control setting up data sources. So the user selects a provider and then fills in the connection details. I then need to create a new data source from this to be stored in mapguide. Can you do this using the Meastro API alone? Kenneth Skovhede, GEOGRAF A/S wrote: > I believe the problem is the .Net UTF-8 Encoder prefixes an UTF-8 BOM, > which causes problems in the Xml parser: > http://trac.osgeo.org/mapguide/ticket/233 > > You can try to create the UTF-8 encoder with: > > UTF8Encoding utf8 = new UTF8Encoding(false); > > > And see if the problem goes away. > Alternatively you can use the MaestroAPI instead of messing with the > raw > Xml: > http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > >>> ___ >>> 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://www.nabble.com/XML-Parser-error-for-Feature-Sources-tp20770245p20787959.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] Permanent changes in data
It is something stupid, but I cannot spot it... Everything works if I omit the bold part of the code : function MakeLine($name, $x0, $y0 , $x1, $y1) { $propertyCollection = new MgPropertyCollection(); *$cntr = (double) 11.0 ; $idProperty = new MgDoubleProperty("ID",$cntr); $propertyCollection->Add($idProperty); *$owner = "Aaa" ; $ownerProperty = new MgStringProperty("Owner", $owner); $propertyCollection->Add($ownerProperty); $nameProperty = new MgStringProperty("Purpose", $name); $propertyCollection->Add($nameProperty); $wktReaderWriter = new MgWktReaderWriter(); $agfReaderWriter = new MgAgfReaderWriter(); $agftext = "LINESTRING XY ($x0 $y0, $x1 $y1)" ; $geometry = $wktReaderWriter->Read( $agftext); $geometryByteReader = $agfReaderWriter->Write($geometry); $geometryProperty = new MgGeometryProperty("Geometry", $geometryByteReader); $propertyCollection->Add($geometryProperty); return $propertyCollection; } MG Studio says this property is Double Stefan Dalakov Kenneth Skovhede, GEOGRAF A/S wrote: You could be affected by this bug: http://trac.osgeo.org/mapguide/ticket/649 Otherwise, try to post a section of the code, maybe someone will spot something obvious. Regards, Kenneth Skovhede, GEOGRAF A/S Stefan Dalakov skrev: Hi all, I am trying to add a feature (permanently) to a data source. I am using MGOS 1.2 and tried Sheboygan samples, where this part is not working, I have not explored the reason yet. My idea is to digitize a feature ( a line ) and add it permanently to an existing layer on the map. I wrote some code, and everything seems OK, no errors, but at the end I have no feature added. Can someone help with a piece of code ? Thanks in advance Stefan Dalakov ___ 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