Re: [mapguide-users] What GDAL version is 2.6 RC 1?
I've tried to follow the tips in the wiki above to configure the Gdal provider for MGOS 2.6 without success. Has anyone found a valid configuration? -- View this message in context: http://osgeo-org.1560.x6.nabble.com/What-GDAL-version-is-2-6-RC-1-tp5151348p5155997.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] SQLServer 2008 Spatial Views
Hi, I've the following problem: I've created a SQL view with a simple join between two db tables. Then I created a dataconnection using FDO SQLserver 2008 provider, and a layer with the above view as datasource. I see all the features on then map, but they aren't selectable; trying with a view without joins, it works fine. Are views supported in SQLServer Spatial Data Connection? Is it an FDO bug? I'm using FDO 3.5. Thanks. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/SQLServer-2008-Spatial-Views-tp7146309p7146309.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] Re: MG on ipad safari
Hi Peter, I've always the same problems. Have you some idea? Thanks in advance, Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/MG-on-ipad-safari-tp5876764p5954695.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] MG on ipad safari
I have a web application that uses MGOS 2.1.0 and ajax viewer: it works fine on IE, Safari, Mozilla and Chrome, but if I try to use it from ipad portable safari, when I load the ajaxviewer, the map is loaded, but it refreshes endless, flickering all the time. Any idea? Thanks, Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/MG-on-ipad-safari-tp5876764p5876764.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] Set NULL value
How can I set programmatically the NULL value in a property? Thanks, Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Set-NULL-value-tp5646753p5646753.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] Re: Set NULL value
Using SetNull(true), you enable the property to be Null, but I need to set the value Null into a property for a selected object. Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Set-NULL-value-tp5646753p5647320.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] Re: MGOS 2.1 ECW
Someone can help me? I need to know if the five ddls added are in the right folder. And their versions are the right versions? There is something else to add or to set? Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/MGOS-2-1-ECW-tp5483493p5490139.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] Runtime map definition
Where can I find the runtime map definition (with layer turned off or turned on by the user) using MapGuide Api? Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Runtime-map-definition-tp5490144p5490144.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] MGOS 2.1 ECW
I've upgraded MapGuide from 2.0.2 to 2.1.0, and now ECWs don't work. I put gdalplugins folder with gdal_ECW_JP2ECW.dll (dated 06/02/2010) and the four dll NCSxxx (version 3.3.0.183) in server\bin folder, but it does't solve the problem. In Maestro, adding a Gdal dataconnection I have the following error: Spatial context extent appears to be invalid (or default) and loading the map with ajaxviewer in error.log there is the following error: 2010-08-31T17:54:16 1896Ajax Viewer 100.0.0.72 Anonymous Error: Failed to stylize layer: ecw1 The coordinate system initialization failed. Could not initialize the geodetic transformation. Thanks, Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/MGOS-2-1-ECW-tp5483493p5483493.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] Read DB data connection schema
I created programmatically a new ODBC data connection with an Oracle DB (v. 9.2.0.1) using a custom connection string. Just created, the configuration document is missing, until I rebuild the schema from Maestro. How can I read/refresh the schema programmatically? I'm using MapGuideOS 2.0.2. Thanks, Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Read-DB-data-connection-schema-tp5363059p5363059.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] Set Spatial Context programmatically
I created programmatically an SDF feature source in MG session, and I want to set its spatial context. How is it possible? Have you some example? Thanks -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Set-Spatial-Context-programmatically-tp5354441p5354441.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] Custom connection to DB Oracle
Hi, I need to connect to an Oracle DB using a connection string. So, using Maestro, I created an new dataconnection FDO ODBC provider, then I selected 'Custom connectionstring' option, and I wrote my connection string: Driver=Oracle in OraHome92;Dbq=MyDbq;Uid=MyUid;Pwd=MyPwd; The connection test returns 'provider reported no errors', but if I try to 'Configure Columns' or 'Rebuild schema', it returns ever the following error: - MgResourceServiceHandler.ProcessOperation line 80 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceServiceHandler.cpp - MgOpSetResource.Execute line 103 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\OpSetResource.cpp - MgServerResourceService.SetResource line 713 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ServerResourceService.cpp - MgServerFeatureService.NotifyResourcesChanged line 1457 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\ServerFeatureService.cpp - MgFdoConnectionManager.RemoveCachedFdoConnection line 1006 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\common\manager\FdoConnectionManager.cpp Please try your operation later as the resource was busy: Session:88aaa906---8001-000bcd727323_en_7F010AFC0AFB0AFA//de695c41-ffbb-4a02-832b-c95117280462.FeatureSource The problem happens using FDO 3.3 and 3.4. Can you help me? Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Custom-connection-to-DB-Oracle-tp5347249p5347249.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] Join with Oracle DB
I have two data connections: the first is a connection to a SHP file, and the second is an ODBC connection to an Oracle DB. I extended my SHP with a table on Oracle DB using a database join, and I created a layer that uses the join as feature source. It seems all ok but when I try to use the joined properties (for example to build the layer style), it causes the following error: Error: An unclassified exception occurred. StackTrace: - MgFeatureServiceHandler.ProcessOperation line 83 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\FeatureServiceHandler.cpp - MgOpSelectFeatures.Execute line 109 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\OpSelectFeatures.cpp - MgServiceOperation.EndExecution line 533 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\common\base\ServiceOperation.cpp - MgServerGwsFeatureReader.Serialize line 1061 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\ServerGwsFeatureReader.cpp - MgServerGwsGetFeatures.GetFeatures line 115 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\ServerGwsGetFeatures.cpp - MgServerGwsGetFeatures.GetMgClassDefinition line 277 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\feature\ServerGwsGetFeatures.cpp An unclassified exception occurred. The same thing but using SQLServer instead of Oracle works fine. I'm using MGOS 2.0.2 and Oracle 9.2. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Join-with-Oracle-DB-tp5338542p5338542.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] SetResourceData: resource was busy
Hi, I need to update dinamically my ODBC feature source but, when I save it, many times (but not ever) I have the following error: Please try your operation later as the resource was busy: Library://.../DB.FeatureSource This is an extract of my code: Dim dbResID as New MgResourceIdentifier(Library://.../DB.FeatureSource) Dim dbByteRead as MgResourceService = mgResourceService.GetResourceData(dbResID, config) Dim dbXML As New XmlDocument dbXML.LoadXml(dbByteRead.ToString) . . edit xml . . Dim dbByteSrc As New MgByteSource(Encoding.UTF8.GetBytes(dbXML.OuterXml), Encoding.UTF8.GetByteCount(dbXML.OuterXml)) Call dbByteSrc.SetMimeType(MgMimeType.Xml) resourceSrvc.SetResourceData(dbResID, config, Stream, dbByteSrc.GetReader()) Thanks, Fabio -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/SetResourceData-resource-was-busy-tp5315816p5315816.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] Re: SetResourceData: resource was busy
I'm using version 2.0.2, and in this context I don't use featurereader. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/SetResourceData-resource-was-busy-tp5315816p5316817.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] View status bar
Using ajax viewer, how can I show the status bar in windows opened from invoke url? Thanks, Fabio -- View this message in context: http://n2.nabble.com/View-status-bar-tp4707595p4707595.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] Re: Invoke URL window status bar
Anyone can help me??? -- View this message in context: http://n2.nabble.com/Invoke-URL-window-status-bar-tp4694671p4701334.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] Add geometry to SHP
Hi Jackie, yes, the ReleaseReader is from the samples. Jackie Ng wrote: What does your ReleaseReader() look like? If it's from the samples, it's supposed to close any open MgFeatureReaders that may exist in the result returned from MgFeatureService.UpdateFeatures() - Jackie sekko970 wrote: I tryng to add a point to an existing SHP data connection in ASP.Net application, using MG API. Dim dataSource as String = Library://.../MySHP.FeatureSource Dim dataSourceId As New MgResourceIdentifier(dataSource) Dim MyProps As New MgPropertyCollection() Dim agfRW As New MgAgfReaderWriter() Dim geomFactory As New MgGeometryFactory Dim myPoint As MgPoint = geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y)) 'ID Dim IDProp As New MgInt32Property(FeatID, IDValue) MyProps.Add(IDProp) 'MyProp Dim MyProp As New MgDoubleProperty(MyProp, MyPropValue) MyProps.Add(MyProp) 'Geometry Dim geomReader As MgByteReader = agfRW.Write(myPoint) Dim geometryProp As New MgGeometryProperty(Geometry, geomReader) MyProps.Add(geometryProp) Dim propCollection As New MgBatchPropertyCollection() propCollection.Add(MyProps) Dim commands As New MgFeatureCommandCollection() commands.Add(New MgInsertFeatures(MyFeatureName, propCollection)) Dim res As MgPropertyCollection = featureSrvc.UpdateFeatures(dataSourceId, commands, False) ReleaseReader(res, commands) In ReleaseReader, I have the following error: Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type 'OSGeo.MapGuide.MgFeatureProperty'. In fact, res has only one property of type MgStringProperty: but why? Have you any idea where is the error? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3957516.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] Add geometry to SHP
Hi Simon, what I have to do to include in my ASP.NET project FDO .NET API? Simon Pelicon wrote: Hi! Here is sample in C# from my code using just FDO .NET API. This inserts FEATURE in any FDO datasource specified in my FDO connection (m_Conn) like SHP,SDF, oracle IInsert command = (IInsert)m_base.m_Conn.CreateCommand(CommandType.CommandType_Insert); FgfGeometryFactory factory = new FgfGeometryFactory(); IDirectPosition position = factory.CreatePositionXYZ(X,Y, 0.0); IPoint point = factory.CreatePoint(position); command .PropertyValues.Add(new PropertyValue(GEOMETRY_COLUMN, new GeometryValue(factory.GetFgf(point; command .PropertyValues.Add(new PropertyValue(LAYER_COLUMN, new StringValue(bref.Layer))); command .PropertyValues.Add(new PropertyValue(BLOCK_COLUMN, new StringValue(bref.Name))); reader = command.Execute(); if (reader.ReadNext()) { } Simon On Fri, Nov 6, 2009 at 8:27 AM, Dejan Gregor dejan.gre...@gmail.com wrote: Dear Fabio, you are saying that with the exsiting FDO it is possible to add geometry to a SHP? Do you have a sample code for MGOS 2.x also for the interface or maybe a whole project/sln? I am not a programmer, but would like just to test this functionality in MapGuide. Best regards, Dejan On Fri, Nov 6, 2009 at 00:29, Zac Spitzer zac.spit...@gmail.com wrote: what's in the string? it's probably an error string if your feature source readonly? http://trac.osgeo.org/mapguide/ticket/649 a very nasty annoying bug z On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng jumpinjac...@gmail.com wrote: What does your ReleaseReader() look like? If it's from the samples, it's supposed to close any open MgFeatureReaders that may exist in the result returned from MgFeatureService.UpdateFeatures() - Jackie sekko970 wrote: I tryng to add a point to an existing SHP data connection in ASP.Net application, using MG API. Dim dataSource as String = Library://.../MySHP.FeatureSource Dim dataSourceId As New MgResourceIdentifier(dataSource) Dim MyProps As New MgPropertyCollection() Dim agfRW As New MgAgfReaderWriter() Dim geomFactory As New MgGeometryFactory Dim myPoint As MgPoint = geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y)) 'ID Dim IDProp As New MgInt32Property(FeatID, IDValue) MyProps.Add(IDProp) 'MyProp Dim MyProp As New MgDoubleProperty(MyProp, MyPropValue) MyProps.Add(MyProp) 'Geometry Dim geomReader As MgByteReader = agfRW.Write(myPoint) Dim geometryProp As New MgGeometryProperty(Geometry, geomReader) MyProps.Add(geometryProp) Dim propCollection As New MgBatchPropertyCollection() propCollection.Add(MyProps) Dim commands As New MgFeatureCommandCollection() commands.Add(New MgInsertFeatures(MyFeatureName, propCollection)) Dim res As MgPropertyCollection = featureSrvc.UpdateFeatures(dataSourceId, commands, False) ReleaseReader(res, commands) In ReleaseReader, I have the following error: Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type 'OSGeo.MapGuide.MgFeatureProperty'. In fact, res has only one property of type MgStringProperty: but why? Have you any idea where is the error? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.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 Solution Architect / Director Ennoble Consultancy Australia http://www.ennoble.com.au 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 ___ 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/Add-geometry-to-SHP-tp3953583p3957522.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] Add geometry to SHP
Ok for OSGeo.FDO.dll OSGeo.FDO.Geometry.dll OSGeo.FDO.Common.dll but if I try to create a reference to OSGeo.FDO.Spatial.dll, I have the following error: no type libraries were found in the component. (FDOSpatial.dll is already in my project bin folder). f. Simon Pelicon wrote: Hi! Add references to this files: OSGeo.FDO.dll OSGeo.FDO.Geometry.dll OSGeo.FDO.Common.dll OSGeo.FDO.Spatial.dll simon On Fri, Nov 6, 2009 at 9:41 AM, sekko970 fabio.francesch...@techneteam.itwrote: Hi Simon, what I have to do to include in my ASP.NET project FDO .NET API? Simon Pelicon wrote: Hi! Here is sample in C# from my code using just FDO .NET API. This inserts FEATURE in any FDO datasource specified in my FDO connection (m_Conn) like SHP,SDF, oracle IInsert command = (IInsert)m_base.m_Conn.CreateCommand(CommandType.CommandType_Insert); FgfGeometryFactory factory = new FgfGeometryFactory(); IDirectPosition position = factory.CreatePositionXYZ(X,Y, 0.0); IPoint point = factory.CreatePoint(position); command .PropertyValues.Add(new PropertyValue(GEOMETRY_COLUMN, new GeometryValue(factory.GetFgf(point; command .PropertyValues.Add(new PropertyValue(LAYER_COLUMN, new StringValue(bref.Layer))); command .PropertyValues.Add(new PropertyValue(BLOCK_COLUMN, new StringValue(bref.Name))); reader = command.Execute(); if (reader.ReadNext()) { } Simon On Fri, Nov 6, 2009 at 8:27 AM, Dejan Gregor dejan.gre...@gmail.com wrote: Dear Fabio, you are saying that with the exsiting FDO it is possible to add geometry to a SHP? Do you have a sample code for MGOS 2.x also for the interface or maybe a whole project/sln? I am not a programmer, but would like just to test this functionality in MapGuide. Best regards, Dejan On Fri, Nov 6, 2009 at 00:29, Zac Spitzer zac.spit...@gmail.com wrote: what's in the string? it's probably an error string if your feature source readonly? http://trac.osgeo.org/mapguide/ticket/649 a very nasty annoying bug z On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng jumpinjac...@gmail.com wrote: What does your ReleaseReader() look like? If it's from the samples, it's supposed to close any open MgFeatureReaders that may exist in the result returned from MgFeatureService.UpdateFeatures() - Jackie sekko970 wrote: I tryng to add a point to an existing SHP data connection in ASP.Net application, using MG API. Dim dataSource as String = Library://.../MySHP.FeatureSource Dim dataSourceId As New MgResourceIdentifier(dataSource) Dim MyProps As New MgPropertyCollection() Dim agfRW As New MgAgfReaderWriter() Dim geomFactory As New MgGeometryFactory Dim myPoint As MgPoint = geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y)) 'ID Dim IDProp As New MgInt32Property(FeatID, IDValue) MyProps.Add(IDProp) 'MyProp Dim MyProp As New MgDoubleProperty(MyProp, MyPropValue) MyProps.Add(MyProp) 'Geometry Dim geomReader As MgByteReader = agfRW.Write(myPoint) Dim geometryProp As New MgGeometryProperty(Geometry, geomReader) MyProps.Add(geometryProp) Dim propCollection As New MgBatchPropertyCollection() propCollection.Add(MyProps) Dim commands As New MgFeatureCommandCollection() commands.Add(New MgInsertFeatures(MyFeatureName, propCollection)) Dim res As MgPropertyCollection = featureSrvc.UpdateFeatures(dataSourceId, commands, False) ReleaseReader(res, commands) In ReleaseReader, I have the following error: Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type 'OSGeo.MapGuide.MgFeatureProperty'. In fact, res has only one property of type MgStringProperty: but why? Have you any idea where is the error? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.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 Solution Architect / Director Ennoble Consultancy Australia http://www.ennoble.com.au 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 ___ 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
Re: [mapguide-users] Add geometry to SHP
I have already downloaded all the dll for FDO Windows SDK, but 3.4 version. f. Simon Pelicon wrote: You have all this files (also OSGeo.FDO.Spatial.dll ) in FDO Windows SDK. download link: http://fdo.osgeo.org/content/fdo-331-downloads http://fdo.osgeo.org/content/fdo-331-downloadssimon On Fri, Nov 6, 2009 at 10:58 AM, sekko970 fabio.francesch...@techneteam.itwrote: Ok for OSGeo.FDO.dll OSGeo.FDO.Geometry.dll OSGeo.FDO.Common.dll but if I try to create a reference to OSGeo.FDO.Spatial.dll, I have the following error: no type libraries were found in the component. (FDOSpatial.dll is already in my project bin folder). f. Simon Pelicon wrote: Hi! Add references to this files: OSGeo.FDO.dll OSGeo.FDO.Geometry.dll OSGeo.FDO.Common.dll OSGeo.FDO.Spatial.dll simon On Fri, Nov 6, 2009 at 9:41 AM, sekko970 fabio.francesch...@techneteam.itwrote: Hi Simon, what I have to do to include in my ASP.NET project FDO .NET API? Simon Pelicon wrote: Hi! Here is sample in C# from my code using just FDO .NET API. This inserts FEATURE in any FDO datasource specified in my FDO connection (m_Conn) like SHP,SDF, oracle IInsert command = (IInsert)m_base.m_Conn.CreateCommand(CommandType.CommandType_Insert); FgfGeometryFactory factory = new FgfGeometryFactory(); IDirectPosition position = factory.CreatePositionXYZ(X,Y, 0.0); IPoint point = factory.CreatePoint(position); command .PropertyValues.Add(new PropertyValue(GEOMETRY_COLUMN, new GeometryValue(factory.GetFgf(point; command .PropertyValues.Add(new PropertyValue(LAYER_COLUMN, new StringValue(bref.Layer))); command .PropertyValues.Add(new PropertyValue(BLOCK_COLUMN, new StringValue(bref.Name))); reader = command.Execute(); if (reader.ReadNext()) { } Simon On Fri, Nov 6, 2009 at 8:27 AM, Dejan Gregor dejan.gre...@gmail.com wrote: Dear Fabio, you are saying that with the exsiting FDO it is possible to add geometry to a SHP? Do you have a sample code for MGOS 2.x also for the interface or maybe a whole project/sln? I am not a programmer, but would like just to test this functionality in MapGuide. Best regards, Dejan On Fri, Nov 6, 2009 at 00:29, Zac Spitzer zac.spit...@gmail.com wrote: what's in the string? it's probably an error string if your feature source readonly? http://trac.osgeo.org/mapguide/ticket/649 a very nasty annoying bug z On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng jumpinjac...@gmail.com wrote: What does your ReleaseReader() look like? If it's from the samples, it's supposed to close any open MgFeatureReaders that may exist in the result returned from MgFeatureService.UpdateFeatures() - Jackie sekko970 wrote: I tryng to add a point to an existing SHP data connection in ASP.Net application, using MG API. Dim dataSource as String = Library://.../MySHP.FeatureSource Dim dataSourceId As New MgResourceIdentifier(dataSource) Dim MyProps As New MgPropertyCollection() Dim agfRW As New MgAgfReaderWriter() Dim geomFactory As New MgGeometryFactory Dim myPoint As MgPoint = geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y)) 'ID Dim IDProp As New MgInt32Property(FeatID, IDValue) MyProps.Add(IDProp) 'MyProp Dim MyProp As New MgDoubleProperty(MyProp, MyPropValue) MyProps.Add(MyProp) 'Geometry Dim geomReader As MgByteReader = agfRW.Write(myPoint) Dim geometryProp As New MgGeometryProperty(Geometry, geomReader) MyProps.Add(geometryProp) Dim propCollection As New MgBatchPropertyCollection() propCollection.Add(MyProps) Dim commands As New MgFeatureCommandCollection() commands.Add(New MgInsertFeatures(MyFeatureName, propCollection)) Dim res As MgPropertyCollection = featureSrvc.UpdateFeatures(dataSourceId, commands, False) ReleaseReader(res, commands) In ReleaseReader, I have the following error: Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type 'OSGeo.MapGuide.MgFeatureProperty'. In fact, res has only one property of type MgStringProperty: but why? Have you any idea where is the error? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.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 Solution Architect / Director Ennoble Consultancy Australia http://www.ennoble.com.au http://zacster.blogspot.com +61 405 847 168
Re: [mapguide-users] Add geometry to SHP
The problem is that I cannot include FDOSpatial.dll in my project. In fact, if I try to create a reference to OSGeo.FDO.Spatial.dll, I have the following error: no type libraries were found in the component (FDOSpatial.dll is already in my project bin folder). f. sekko970 wrote: I have already downloaded all the dll for FDO Windows SDK, but 3.4 version. f. Simon Pelicon wrote: You have all this files (also OSGeo.FDO.Spatial.dll ) in FDO Windows SDK. download link: http://fdo.osgeo.org/content/fdo-331-downloads http://fdo.osgeo.org/content/fdo-331-downloadssimon On Fri, Nov 6, 2009 at 10:58 AM, sekko970 fabio.francesch...@techneteam.itwrote: Ok for OSGeo.FDO.dll OSGeo.FDO.Geometry.dll OSGeo.FDO.Common.dll but if I try to create a reference to OSGeo.FDO.Spatial.dll, I have the following error: no type libraries were found in the component. (FDOSpatial.dll is already in my project bin folder). f. Simon Pelicon wrote: Hi! Add references to this files: OSGeo.FDO.dll OSGeo.FDO.Geometry.dll OSGeo.FDO.Common.dll OSGeo.FDO.Spatial.dll simon On Fri, Nov 6, 2009 at 9:41 AM, sekko970 fabio.francesch...@techneteam.itwrote: Hi Simon, what I have to do to include in my ASP.NET project FDO .NET API? Simon Pelicon wrote: Hi! Here is sample in C# from my code using just FDO .NET API. This inserts FEATURE in any FDO datasource specified in my FDO connection (m_Conn) like SHP,SDF, oracle IInsert command = (IInsert)m_base.m_Conn.CreateCommand(CommandType.CommandType_Insert); FgfGeometryFactory factory = new FgfGeometryFactory(); IDirectPosition position = factory.CreatePositionXYZ(X,Y, 0.0); IPoint point = factory.CreatePoint(position); command .PropertyValues.Add(new PropertyValue(GEOMETRY_COLUMN, new GeometryValue(factory.GetFgf(point; command .PropertyValues.Add(new PropertyValue(LAYER_COLUMN, new StringValue(bref.Layer))); command .PropertyValues.Add(new PropertyValue(BLOCK_COLUMN, new StringValue(bref.Name))); reader = command.Execute(); if (reader.ReadNext()) { } Simon On Fri, Nov 6, 2009 at 8:27 AM, Dejan Gregor dejan.gre...@gmail.com wrote: Dear Fabio, you are saying that with the exsiting FDO it is possible to add geometry to a SHP? Do you have a sample code for MGOS 2.x also for the interface or maybe a whole project/sln? I am not a programmer, but would like just to test this functionality in MapGuide. Best regards, Dejan On Fri, Nov 6, 2009 at 00:29, Zac Spitzer zac.spit...@gmail.com wrote: what's in the string? it's probably an error string if your feature source readonly? http://trac.osgeo.org/mapguide/ticket/649 a very nasty annoying bug z On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng jumpinjac...@gmail.com wrote: What does your ReleaseReader() look like? If it's from the samples, it's supposed to close any open MgFeatureReaders that may exist in the result returned from MgFeatureService.UpdateFeatures() - Jackie sekko970 wrote: I tryng to add a point to an existing SHP data connection in ASP.Net application, using MG API. Dim dataSource as String = Library://.../MySHP.FeatureSource Dim dataSourceId As New MgResourceIdentifier(dataSource) Dim MyProps As New MgPropertyCollection() Dim agfRW As New MgAgfReaderWriter() Dim geomFactory As New MgGeometryFactory Dim myPoint As MgPoint = geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y)) 'ID Dim IDProp As New MgInt32Property(FeatID, IDValue) MyProps.Add(IDProp) 'MyProp Dim MyProp As New MgDoubleProperty(MyProp, MyPropValue) MyProps.Add(MyProp) 'Geometry Dim geomReader As MgByteReader = agfRW.Write(myPoint) Dim geometryProp As New MgGeometryProperty(Geometry, geomReader) MyProps.Add(geometryProp) Dim propCollection As New MgBatchPropertyCollection() propCollection.Add(MyProps) Dim commands As New MgFeatureCommandCollection() commands.Add(New MgInsertFeatures(MyFeatureName, propCollection)) Dim res As MgPropertyCollection = featureSrvc.UpdateFeatures(dataSourceId, commands, False) ReleaseReader(res, commands) In ReleaseReader, I have the following error: Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type 'OSGeo.MapGuide.MgFeatureProperty'. In fact, res has only one property of type MgStringProperty: but why? Have you any idea where is the error? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users
[mapguide-users] Zoom In - Zoom Out not run
Dear all, I have problems with toolbar zoom in - zoom out functions: they don't run. I'm using MapGuideOS with ajaxviewer .net. Could you help me? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Zoom-In-Zoom-Out-not-run-tp3834339p3834339.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] Zoom In - Zoom Out not run
Yes, from the vertical scroll bar on pan, or using the mouse scrolling, it works. Ivan Miličević-3 wrote: Does pan control works? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Friday, October 16, 2009 10:45 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Zoom In - Zoom Out not run Dear all, I have problems with toolbar zoom in - zoom out functions: they don't run. I'm using MapGuideOS with ajaxviewer .net. Could you help me? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Zoom-In-Zoom-Out-not-run-tp3834339p3834339.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/Zoom-In-Zoom-Out-not-run-tp3834339p3834430.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] Zoom In - Zoom Out not run
MapGuide Server: OS 2.0, Enterprise 2010 OS: Windows XP SP3, Windows Server 2003 R2 Browser: IE7, Firefox 3.0.10 Ivan Miličević-3 wrote: Could you provide information about version of Mapguide Server, OS, browser? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Friday, October 16, 2009 12:01 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Zoom In - Zoom Out not run No, no javascript error. Ivan Miličević-3 wrote: Does javascript throw some error? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Friday, October 16, 2009 11:07 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Zoom In - Zoom Out not run Yes, from the vertical scroll bar on pan, or using the mouse scrolling, it works. Ivan Miličević-3 wrote: Does pan control works? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Friday, October 16, 2009 10:45 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Zoom In - Zoom Out not run Dear all, I have problems with toolbar zoom in - zoom out functions: they don't run. I'm using MapGuideOS with ajaxviewer .net. Could you help me? Thanks, Fabio -- View this message in context: http://n2.nabble.com/Zoom-In-Zoom-Out-not-run-tp3834339p3834339.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/Zoom-In-Zoom-Out-not-run-tp3834339p3834430.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/Zoom-In-Zoom-Out-not-run-tp3834339p3834656.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/Zoom-In-Zoom-Out-not-run-tp3834339p3835227.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] Spatial Context for ODBC data connection
Dear Kenneth, using the last preview version of Maestro, when we set the coordinate system override for ODBC data connection, the following error appears: System.Net.WebException: Errore del server remoto: (559) MgCoordinateSystemConversionFailedException. in System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest request) in System.Net.WebClient.DownloadData(Uri address) in System.Net.WebClient.DownloadData(String address) in OSGeo.MapGuide.MaestroAPI.HttpCoordinateSystem.ConvertWktToCoordinateSystemCode(String wkt) in OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditorODBC.Save(String savename) in OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditorODBC.ValidateResource(Boolean recurse) in OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditorBase.ValidateResource(Boolean recurse) in OSGeo.MapGuide.Maestro.EditorInterface.Save(String resid) in OSGeo.MapGuide.Maestro.FormMain.SaveResource() in OSGeo.MapGuide.Maestro.FormMain.SaveResourceButton_Click(Object sender, EventArgs e) in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) in System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) in System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) in System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) in System.Windows.Forms.Control.WmMouseUp(Message m, MouseButtons button, Int32 clicks) in System.Windows.Forms.Control.WndProc(Message m) in System.Windows.Forms.ScrollableControl.WndProc(Message m) in System.Windows.Forms.ToolStrip.WndProc(Message m) in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message m) in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) As you can see in following xml editor substring, with our current Maestro version (1.0.9.15910), we save the coordinate system override for ODBC data connection without any problem: SupplementalSpatialContextInfo NameDefault/Name CoordinateSystemPROJCS[Monte Mario / Italy zone 1,GEOGCS[Monte Mario,DATUM[Monte_Mario,SPHEROID[International 1924,6378388,297,AUTHORITY[EPSG,7022]],AUTHORITY[EPSG,6265]],PRIMEM[Greenwich,0,AUTHORITY[EPSG,8901]],UNIT[degree,0.01745329251994328,AUTHORITY[EPSG,9122]],AUTHORITY[EPSG,4265]],PROJECTION[Transverse_Mercator],PARAMETER[latitude_of_origin,0],PARAMETER[central_meridian,9],PARAMETER[scale_factor,0.9996],PARAMETER[false_easting,150],PARAMETER[false_northing,0],UNIT[metre,1,AUTHORITY[EPSG,9001]],AUTHORITY[EPSG,3003]]/CoordinateSystem /SupplementalSpatialContextInfo but the spatial context info is still empty: ?xml version=1.0? FdoSpatialContextList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xsi:noNamespaceSchemaLocation=FdoSpatialContextList-1.0.0.xsd ProviderName / /FdoSpatialContextList Can you help me? Fabio --- nasp wrote: Thank you very much. I'm going to download last preview version of Maestro. I will post results after testing my application. Regards, Naspi Kenneth Skovhede, GEOGRAF A/S wrote: I you are using Maestro, you must use the latest preview version. ODBC handles projection a little different than the other providers, and this has been adressed recently. Regards, Kenneth Skovhede, GEOGRAF A/S nasp skrev: Hi, I don't know how to set spatial context in my ODBC data connection to SQL server. For this reason I can't set coordinate system overrides. As a conseguences I can't make a buffer for a point resource belonging to ODBC data connection. Please, could someone help me? Regards, Naspi ___ 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/Spatial-Context-for-ODBC-data-connection-tp3048587p3182139.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] Create programmatically a map
This is the result of posting: ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://MyApp/AppLayouts/MyLayout.WebLayout/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-03-04T15:50:26Z/CreatedDate ModifiedDate2009-03-04T17:02:27Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList I also found that the error is originated if the XML has nodes like FunctionCommand/Function; if the XML has nodes like FunctionSeparator/Function, there aren't errors. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Have you tried posting the document to the webform? http://localhost/mapguide/mapagent/index.html Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Dear all, I just found the cause of my problem. My web-layout xml template is a copy of a new layout XML structure created from MGMaestro: ?xml version=1.0 encoding=utf-8? WebLayout xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xsi:noNamespaceSchemaLocation=WebLayout-1.0.0.xsd TitleMyMapTitle/Title Map ResourceIdMyMap.MapDefinition/ResourceId HyperlinkTargetTaskPane/HyperlinkTarget /Map ToolBar Visibletrue/Visible Button xsi:type=CommandItemType FunctionCommand/Function CommandPrint/Command /Button . /ToolBar InformationPane Visibletrue/Visible Width200/Width LegendVisibletrue/LegendVisible PropertiesVisibletrue/PropertiesVisible /InformationPane ContextMenu Visibletrue/Visible MenuItem xsi:type=CommandItemType FunctionCommand/Function CommandSelect/Command /MenuItem . /ContextMenu TaskPane Visibletrue/Visible Width280/Width TaskBar Visibletrue/Visible Home NameHome/Name TooltipReturn to home task page/Tooltip DescriptionReturn to home task page/Description ImageURL../stdicons/icon_home.gif/ImageURL DisabledImageURL../stdicons/icon_home_disabled.gif/DisabledImageURL /Home Forward NameForward/Name TooltipForward to next task page/Tooltip DescriptionForward to next task page/Description ImageURL../stdicons/icon_forward.gif/ImageURL DisabledImageURL../stdicons/icon_forward_disabled.gif/DisabledImageURL /Forward Back NameBack/Name TooltipReturn to previous task page/Tooltip DescriptionReturn to previous task page/Description ImageURL../stdicons/icon_back.gif/ImageURL DisabledImageURL../stdicons/icon_back_disabled.gif/DisabledImageURL /Back Tasks NameTasks/Name TooltipTask list/Tooltip DescriptionView a list of available tasks/Description ImageURL../stdicons/icon_tasks.gif/ImageURL DisabledImageURL../stdicons/icon_tasks_disabled.gif/DisabledImageURL /Tasks MenuButton xsi:type=CommandItemType FunctionCommand/Function CommandMeasure/Command /MenuButton . /TaskBar /TaskPane StatusBar Visibletrue/Visible /StatusBar ZoomControl Visibletrue/Visible /ZoomControl CommandSet Command xsi:type=BasicCommandType NamePan/Name LabelPan/Label TooltipPan mode/Tooltip
Re: [mapguide-users] Create programmatically a map
Hi Kenneth, I solved the problem. I write you the solution, in the hope that it can be useful. The error is generated because in my XML template were missing the nodes PrintLayout ResourceId/ResourceId /PrintLayout as childs of Command xsi:type=PrintCommandType node, even if these nodes are not generated from MGMaestro saving a new WebLayout as XML, and the PrintLayout element is descripted as optional (minOccurs=0) in WebLayout-1.0.0.xsd schema file. Thanks for your help. Fabio -- sekko970 wrote: This is the result of posting: ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://MyApp/AppLayouts/MyLayout.WebLayout/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-03-04T15:50:26Z/CreatedDate ModifiedDate2009-03-04T17:02:27Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList I also found that the error is originated if the XML has nodes like FunctionCommand/Function; if the XML has nodes like FunctionSeparator/Function, there aren't errors. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Have you tried posting the document to the webform? http://localhost/mapguide/mapagent/index.html Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Dear all, I just found the cause of my problem. My web-layout xml template is a copy of a new layout XML structure created from MGMaestro: ?xml version=1.0 encoding=utf-8? WebLayout xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xsi:noNamespaceSchemaLocation=WebLayout-1.0.0.xsd TitleMyMapTitle/Title Map ResourceIdMyMap.MapDefinition/ResourceId HyperlinkTargetTaskPane/HyperlinkTarget /Map ToolBar Visibletrue/Visible Button xsi:type=CommandItemType FunctionCommand/Function CommandPrint/Command /Button . /ToolBar InformationPane Visibletrue/Visible Width200/Width LegendVisibletrue/LegendVisible PropertiesVisibletrue/PropertiesVisible /InformationPane ContextMenu Visibletrue/Visible MenuItem xsi:type=CommandItemType FunctionCommand/Function CommandSelect/Command /MenuItem . /ContextMenu TaskPane Visibletrue/Visible Width280/Width TaskBar Visibletrue/Visible Home NameHome/Name TooltipReturn to home task page/Tooltip DescriptionReturn to home task page/Description ImageURL../stdicons/icon_home.gif/ImageURL DisabledImageURL../stdicons/icon_home_disabled.gif/DisabledImageURL /Home Forward NameForward/Name TooltipForward to next task page/Tooltip DescriptionForward to next task page/Description ImageURL../stdicons/icon_forward.gif/ImageURL DisabledImageURL../stdicons/icon_forward_disabled.gif/DisabledImageURL /Forward Back NameBack/Name TooltipReturn to previous task page/Tooltip DescriptionReturn to previous task page/Description ImageURL../stdicons/icon_back.gif/ImageURL DisabledImageURL../stdicons/icon_back_disabled.gif/DisabledImageURL /Back Tasks NameTasks/Name TooltipTask list/Tooltip DescriptionView a list of available tasks/Description ImageURL../stdicons/icon_tasks.gif/ImageURL DisabledImageURL../stdicons/icon_tasks_disabled.gif/DisabledImageURL /Tasks MenuButton
Re: [mapguide-users] Create programmatically a map
are using the native API, which, IMO, has some quirks. Maestro uses the http interface to store the file, so that is equivalent to posting using the webform. Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: The file is 21K. I tryed also to load it directly from Maestro, and I have had no problem. -- Kenneth Skovhede, GEOGRAF A/S wrote: Just to be sure... The xml you posted is the ResourceHeader, and not the ResourceContent, so it does not really show what the problem may be. The error from the log states that the runtime map is not created, which is strange because a WebLayout cannot reference a runtime map. The other error you posted seemed to indicate that the Print command was invalid inside the WebLayout. Can you try so save the xml, just before you write it to the MgByteStream? Then try to post the file, using the SetResource in the webform mentioned earlier. If you get the same error, try to post the file somewhere, and provide a link. Be carefull not to copy/paste, but post the actual file. Btw. how large is the file? larger than 8K? 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://n2.nabble.com/Create-programmatically-a-map-tp2314238p2423348.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] Create programmatically a map
Hi Kenneth, I need again your help about my problem. I think the problem is that after new map run-time creation in library repository, I cannot use its map definition to create its web layout. How can I assign the new map to the layout? Thanks again, Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Try to look at the Maestro code: http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs#L182 Hopefully you will find a small difference there. Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Yes, the OuterXml property contains the XML header line. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Does the OuterXml property contain the ? version=1.0 encoding=utf-8 standalone=true ? line? Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Hi Kenneth, and thanks for your promptly reply. I had used an ancoding instance. Below, you can see my code to create the new map: Dim resID As New MgResourceIdentifier(Library://.../maps/MyMap.MapDefinition) Dim enc As New System.Text.UTF8Encoding(False) Dim newMapDef As New MgByteSource(enc.GetBytes(XMLMapTemplate.OuterXml), enc.GetByteCount(XMLMapTemplate.OuterXml)) newMapDef.SetMimeType(MgMimeType.Xml) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newMapDef.GetReader(), Nothing) Dim map As New MgMap() map.Create(resourceSrvc, resID, MapName) ... Then, this is my code to create the map layout: Dim resID As New MgResourceIdentifier(Library://.../Layouts/MyMap.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(XMLLayoutTemplate.OuterXml), enc.GetByteCount(XMLLayoutTemplate.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) Thanks for your help. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: You could have the problem that .Net emits an utf-8 byte-order-marker (BOM), when writing xml. http://en.wikipedia.org/wiki/Byte-order_mark To counter this, explicitly create an encoding instance: System.Text.Encoding enc = new System.Text.UTF8Encoding(false); Then implement a xml writer, or manually convert the xml to bytes, using the encoding. FYI, the MaestroAPI is LGPL, and so you may use it as a library, even for commercial applications, and it handles this quirk and others. Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Dear all, I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from MG Maestro (without any modification), and reloading the map directly from browser, the error disappears and the map is correctly shown. After saving the layout, there aren't differences in map and layout XML definitions. Have you any idea about? Thank you in advance. Fabio ___ 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/Create-programmatically-a-map-tp2314238p2345737.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] Create programmatically a map
Hi Ivan, thanks for your suggestion, but my problem is not to refresh the viewer to show the map just created, but is the correct creation of new map and layout. I think to have found the origin of my problem, but I don't understand the error: Argument is null. Exception occurred in method MgWebLayout.ParsePrintCommand at line 880 in file c:\build_bond_area\bond_nightly\build_41.3\ent\os\web\src\webapp\WebLayout.cpp Have you some idea? Thanks, Fabio -- Ivan Milicevic wrote: Hello, You can change href of mapFrame. Here is sample code. var mapa = cijevi; //defines map name var stringMape = Library%3a%2f%2fPROJEKTI%2fSUPRANET%2fMAPE%2f + mapa; var hrefMapa = http://172.21.10.3/mapguide/mapviewernet/mapframe.aspx?MAPDEFINITION=; + stringMape + .MapDefinitionamp;TYPE=HTMLamp;SHOWLEGEND=0amp;SHOWPROP=0amp;INFOWI DTH=0amp;LOCALE=enamp;HLTGT=1amp;HLTGTNAME=amp;SHOWSLIDER=0amp;SESS ION= + mgSessionId + ; //changing mapFrame href mapFrame.location.href = hrefMapa; Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 9:57 AM To: mapguide-users@lists.osgeo.org Subject: Re: [mapguide-users] Create programmatically a map Hi Kenneth, I need again your help about my problem. I think the problem is that after new map run-time creation in library repository, I cannot use its map definition to create its web layout. How can I assign the new map to the layout? Thanks again, Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Try to look at the Maestro code: http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Lo calNativeConnection.cs#L182 Hopefully you will find a small difference there. Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Yes, the OuterXml property contains the XML header line. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Does the OuterXml property contain the ? version=1.0 encoding=utf-8 standalone=true ? line? Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Hi Kenneth, and thanks for your promptly reply. I had used an ancoding instance. Below, you can see my code to create the new map: Dim resID As New MgResourceIdentifier(Library://.../maps/MyMap.MapDefinition) Dim enc As New System.Text.UTF8Encoding(False) Dim newMapDef As New MgByteSource(enc.GetBytes(XMLMapTemplate.OuterXml), enc.GetByteCount(XMLMapTemplate.OuterXml)) newMapDef.SetMimeType(MgMimeType.Xml) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newMapDef.GetReader(), Nothing) Dim map As New MgMap() map.Create(resourceSrvc, resID, MapName) ... Then, this is my code to create the map layout: Dim resID As New MgResourceIdentifier(Library://.../Layouts/MyMap.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(XMLLayoutTemplate.OuterXml), enc.GetByteCount(XMLLayoutTemplate.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) Thanks for your help. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: You could have the problem that .Net emits an utf-8 byte-order-marker (BOM), when writing xml. http://en.wikipedia.org/wiki/Byte-order_mark To counter this, explicitly create an encoding instance: System.Text.Encoding enc = new System.Text.UTF8Encoding(false); Then implement a xml writer, or manually convert the xml to bytes, using the encoding. FYI, the MaestroAPI is LGPL, and so you may use it as a library, even for commercial applications, and it handles this quirk and others. Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Dear all, I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from
RE: [mapguide-users] Create programmatically a map
This is my problem: I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from MG Maestro (without any modification), and reloading the map directly from browser, the error disappears and the map is correctly shown. After saving the layout, there aren't differences in map and layout XML definitions. Have you any idea about? -- Ivan Milicevic wrote: Can you write pseudo code of your task? What do you want to do? I need little more information about your problem. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 11:42 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Hi Ivan, below, you can see my code to create the new map: Dim resID As New MgResourceIdentifier(Library://.../maps/MyMap.MapDefinition) Dim enc As New System.Text.UTF8Encoding(False) Dim newMapDef As New MgByteSource(enc.GetBytes(XMLMapTemplate.OuterXml), enc.GetByteCount(XMLMapTemplate.OuterXml)) newMapDef.SetMimeType(MgMimeType.Xml) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newMapDef.GetReader(), Nothing) Dim map As New MgMap() map.Create(resourceSrvc, resID, MapName) ... Then, this is my code to create the map layout: Dim resID As New MgResourceIdentifier(Library://.../Layouts/MyMap.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(XMLLayoutTemplate.OuterXml), enc.GetByteCount(XMLLayoutTemplate.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) Perhaps between map and layout creation I should refresh the mapframe as suggested from you? Thanks in advance for your help. Fabio -- Ivan Milicevic wrote: Can you provide us code sample? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 10:38 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Hi Ivan, thanks for your suggestion, but my problem is not to refresh the viewer to show the map just created, but is the correct creation of new map and layout. I think to have found the origin of my problem, but I don't understand the error: Argument is null. Exception occurred in method MgWebLayout.ParsePrintCommand at line 880 in file c:\build_bond_area\bond_nightly\build_41.3\ent\os\web\src\webapp\WebLayo ut.cpp Have you some idea? Thanks, Fabio -- Ivan Milicevic wrote: Hello, You can change href of mapFrame. Here is sample code. var mapa = cijevi; //defines map name var stringMape = Library%3a%2f%2fPROJEKTI%2fSUPRANET%2fMAPE%2f + mapa; var hrefMapa = http://172.21.10.3/mapguide/mapviewernet/mapframe.aspx?MAPDEFINITION=; + stringMape + .MapDefinitionamp;TYPE=HTMLamp;SHOWLEGEND=0amp;SHOWPROP=0amp;INFOWI DTH=0amp;LOCALE=enamp;HLTGT=1amp;HLTGTNAME=amp;SHOWSLIDER=0amp;SESS ION= + mgSessionId + ; //changing mapFrame href mapFrame.location.href = hrefMapa; Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 9:57 AM To: mapguide-users@lists.osgeo.org Subject: Re: [mapguide-users] Create programmatically a map Hi Kenneth, I need again your help about my problem. I think the problem is that after new map run-time creation in library repository, I cannot use its map definition to create its web layout. How can I assign the new map to the layout? Thanks again, Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Try to look at the Maestro code: http
RE: [mapguide-users] Create programmatically a map
Below you can see the new map and layout XML created from http://localhost/mapguide/mapagent/index.html before and after the saving from Maestro (is equals for both). ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newMap.MapDefinition/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:31:29Z/CreatedDate ModifiedDate2009-02-18T11:31:29Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newLayout.WebLayout/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:35:51Z/CreatedDate ModifiedDate2009-02-18T11:36:32Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList -- Ivan Milicevic wrote: Please, before you open layout and map in Maestro go to: http://localhost/mapguide/mapagent/index.html - go to Resource--GetResourceContent-- and type correct resource ID on right side. See is there any strange things in output XML file. Compare it after saving it in Maestro. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 12:05 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map This is my problem: I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from MG Maestro (without any modification), and reloading the map directly from browser, the error disappears and the map is correctly shown. After saving the layout, there aren't differences in map and layout XML definitions. Have you any idea about? -- Ivan Milicevic wrote: Can you write pseudo code of your task? What do you want to do? I need little more information about your problem. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 11:42 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Hi Ivan, below, you can see my code to create the new map: Dim resID As New MgResourceIdentifier(Library://.../maps/MyMap.MapDefinition) Dim enc As New System.Text.UTF8Encoding(False) Dim newMapDef As New MgByteSource(enc.GetBytes(XMLMapTemplate.OuterXml), enc.GetByteCount(XMLMapTemplate.OuterXml)) newMapDef.SetMimeType(MgMimeType.Xml) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newMapDef.GetReader(), Nothing) Dim map As New MgMap() map.Create(resourceSrvc, resID, MapName) ... Then, this is my code to create the map layout: Dim resID As New MgResourceIdentifier(Library://.../Layouts/MyMap.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(XMLLayoutTemplate.OuterXml), enc.GetByteCount(XMLLayoutTemplate.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) Perhaps between map and layout creation I should refresh
RE: [mapguide-users] Create programmatically a map
Sure, this is the related record in error log: 2009-02-18T12:07:11 Administrator Error: Resource was not found: Session:36fb9200--1000-8000-000bcd727323_en_7F010AFC0AFB0AFA//new.Map StackTrace: - MgResourceServiceHandler.ProcessOperation line 80 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceServiceHandler.cpp - MgOpGetResourceData.Execute line 124 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\OpGetResourceData.cpp - MgServerResourceService.GetResourceData line 1401 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ServerResourceService.cpp - MgApplicationRepositoryManager.GetResourceData line 1201 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ApplicationRepositoryManager.cpp - MgResourceContentManager.GetDocument line 590 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceContentManager.cpp - MgResourceDefinitionManager.GetDocument line 476 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\resource\ResourceDefinitionManager.cpp Resource was not found: Session:36fb9200--1000-8000-000bcd727323_en_7F010AFC0AFB0AFA//new.Map -- Ivan Milicevic wrote: Very interesting... Can you check mapguide error log? Is there any records related with this problem? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 12:41 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Below you can see the new map and layout XML created from http://localhost/mapguide/mapagent/index.html before and after the saving from Maestro (is equals for both). ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newMap.MapDefinition/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:31:29Z/CreatedDate ModifiedDate2009-02-18T11:31:29Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newLayout.WebLayout/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:35:51Z/CreatedDate ModifiedDate2009-02-18T11:36:32Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList -- Ivan Milicevic wrote: Please, before you open layout and map in Maestro go to: http://localhost/mapguide/mapagent/index.html - go to Resource--GetResourceContent-- and type correct resource ID on right side. See is there any strange things in output XML file. Compare it after saving it in Maestro. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 12:05 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map This is my problem: I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from MG Maestro (without any modification), and reloading the map directly from browser
RE: [mapguide-users] Create programmatically a map
Each try is failed for the following error: 'Invalid resource type'. Dim resID As New MgResourceIdentifier(Librarry://.../ MyLayout . MgResourceType.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(newLayoutXML.OuterXml), enc.GetByteCount(newLayoutXML.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) resourceSrvc.UpdateRepository(resID, newLayoutDef.GetReader(), Nothing) -- Ivan Milicevic wrote: I'm guessing that you must update repository after creating new layout. Look at http://mapguide.osgeo.org/files/mapguide/docs/2.0/d8/de1/class_mg_resour ce_service_e0294dc308ecc4708b79d493086f210b.htm -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 2:01 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Sure, this is the related record in error log: 2009-02-18T12:07:11 Administrator Error: Resource was not found: Session:36fb9200--1000-8000-000bcd727323_en_7F010AFC0AFB0AFA//ne w.Map StackTrace: - MgResourceServiceHandler.ProcessOperation line 80 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ResourceServiceHandler.cpp - MgOpGetResourceData.Execute line 124 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\OpGetResourceData.cpp - MgServerResourceService.GetResourceData line 1401 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ServerResourceService.cpp - MgApplicationRepositoryManager.GetResourceData line 1201 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ApplicationRepositoryManager.cpp - MgResourceContentManager.GetDocument line 590 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ResourceContentManager.cpp - MgResourceDefinitionManager.GetDocument line 476 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ResourceDefinitionManager.cpp Resource was not found: Session:36fb9200--1000-8000-000bcd727323_en_7F010AFC0AFB0AFA//ne w.Map -- Ivan Milicevic wrote: Very interesting... Can you check mapguide error log? Is there any records related with this problem? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 12:41 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Below you can see the new map and layout XML created from http://localhost/mapguide/mapagent/index.html before and after the saving from Maestro (is equals for both). ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newMap.MapDefinition/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:31:29Z/CreatedDate ModifiedDate2009-02-18T11:31:29Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newLayout.WebLayout/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:35:51Z/CreatedDate ModifiedDate2009-02-18T11:36:32Z/ModifiedDate - ResourceDocumentHeader xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceDocumentHeader-1.0.0.xsd - Security xsi:noNamespaceSchemaLocation=ResourceSecurity-1.0.0.xsd Inheritedtrue/Inherited - Groups - Group NameEveryone/Name Permissionsr,w/Permissions /Group /Groups /Security /ResourceDocumentHeader /ResourceDocument /ResourceList -- Ivan Milicevic wrote: Please, before you
RE: [mapguide-users] Create programmatically a map
Tryed, but no changes. -- Ivan Milicevic wrote: Hm... Try pass byteReader object instead of newLayoutDef.GetReader(). PHP SAMPLE: // Get a resource identifier for the library $resourceID = new MgResourceIdentifier('Library://'); // Read the new content from a file $byteSource = new MgByteSource('C:\Data\Repository\Content.xml'); // Put that MgByteSource into an MgByteReader $byteReader = $byteSource-GetReader(); // Update the repository content $resourceService-UpdateRepository($resourceID, $byteReader, null); -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 3:28 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map I'm sorry Ivan, is a copy/paste error! Ivan Milicevic wrote: Is it double r in resID copy/paste error? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 3:20 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Each try is failed for the following error: 'Invalid resource type'. Dim resID As New MgResourceIdentifier(Librarry://.../ MyLayout . MgResourceType.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(newLayoutXML.OuterXml), enc.GetByteCount(newLayoutXML.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) resourceSrvc.UpdateRepository(resID, newLayoutDef.GetReader(), Nothing) -- Ivan Milicevic wrote: I'm guessing that you must update repository after creating new layout. Look at http://mapguide.osgeo.org/files/mapguide/docs/2.0/d8/de1/class_mg_resour ce_service_e0294dc308ecc4708b79d493086f210b.htm -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 2:01 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Sure, this is the related record in error log: 2009-02-18T12:07:11 Administrator Error: Resource was not found: Session:36fb9200--1000-8000-000bcd727323_en_7F010AFC0AFB0AFA//ne w.Map StackTrace: - MgResourceServiceHandler.ProcessOperation line 80 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ResourceServiceHandler.cpp - MgOpGetResourceData.Execute line 124 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\OpGetResourceData.cpp - MgServerResourceService.GetResourceData line 1401 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ServerResourceService.cpp - MgApplicationRepositoryManager.GetResourceData line 1201 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ApplicationRepositoryManager.cpp - MgResourceContentManager.GetDocument line 590 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ResourceContentManager.cpp - MgResourceDefinitionManager.GetDocument line 476 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services \resource\ResourceDefinitionManager.cpp Resource was not found: Session:36fb9200--1000-8000-000bcd727323_en_7F010AFC0AFB0AFA//ne w.Map -- Ivan Milicevic wrote: Very interesting... Can you check mapguide error log? Is there any records related with this problem? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of sekko970 Sent: Wednesday, February 18, 2009 12:41 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Create programmatically a map Below you can see the new map and layout XML created from http://localhost/mapguide/mapagent/index.html before and after the saving from Maestro (is equals for both). ?xml version=1.0 encoding=UTF-8 ? - ResourceList xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=ResourceList-1.0.0.xsd - ResourceDocument ResourceIdLibrary://.../newMap.MapDefinition/ResourceId Depth3/Depth OwnerAdministrator/Owner CreatedDate2009-02-18T11:31:29Z/CreatedDate ModifiedDate2009-02-18T11:31:29Z
Re: [mapguide-users] Create programmatically a map
The file is 21K. I tryed also to load it directly from Maestro, and I have had no problem. -- Kenneth Skovhede, GEOGRAF A/S wrote: Just to be sure... The xml you posted is the ResourceHeader, and not the ResourceContent, so it does not really show what the problem may be. The error from the log states that the runtime map is not created, which is strange because a WebLayout cannot reference a runtime map. The other error you posted seemed to indicate that the Print command was invalid inside the WebLayout. Can you try so save the xml, just before you write it to the MgByteStream? Then try to post the file, using the SetResource in the webform mentioned earlier. If you get the same error, try to post the file somewhere, and provide a link. Be carefull not to copy/paste, but post the actual file. Btw. how large is the file? larger than 8K? Regards, Kenneth Skovhede, GEOGRAF A/S ___ 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/Create-programmatically-a-map-tp2314238p2347931.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] Create programmatically a map
Yes, the OuterXml property contains the XML header line. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: Does the OuterXml property contain the ? version=1.0 encoding=utf-8 standalone=true ? line? Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Hi Kenneth, and thanks for your promptly reply. I had used an ancoding instance. Below, you can see my code to create the new map: Dim resID As New MgResourceIdentifier(Library://.../maps/MyMap.MapDefinition) Dim enc As New System.Text.UTF8Encoding(False) Dim newMapDef As New MgByteSource(enc.GetBytes(XMLMapTemplate.OuterXml), enc.GetByteCount(XMLMapTemplate.OuterXml)) newMapDef.SetMimeType(MgMimeType.Xml) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newMapDef.GetReader(), Nothing) Dim map As New MgMap() map.Create(resourceSrvc, resID, MapName) ... Then, this is my code to create the map layout: Dim resID As New MgResourceIdentifier(Library://.../Layouts/MyMap.WebLayout) Dim enc As New System.Text.UTF8Encoding(False) Dim newLayoutDef As New MgByteSource(enc.GetBytes(XMLLayoutTemplate.OuterXml), enc.GetByteCount(XMLLayoutTemplate.OuterXml)) newLayoutDef.SetMimeType(MgMimeType.Xml) resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) resourceSrvc.SetResource(resID, newLayoutDef.GetReader(), Nothing) map.Save(resourceSrvc) Thanks for your help. Fabio -- Kenneth Skovhede, GEOGRAF A/S wrote: You could have the problem that .Net emits an utf-8 byte-order-marker (BOM), when writing xml. http://en.wikipedia.org/wiki/Byte-order_mark To counter this, explicitly create an encoding instance: System.Text.Encoding enc = new System.Text.UTF8Encoding(false); Then implement a xml writer, or manually convert the xml to bytes, using the encoding. FYI, the MaestroAPI is LGPL, and so you may use it as a library, even for commercial applications, and it handles this quirk and others. Regards, Kenneth Skovhede, GEOGRAF A/S sekko970 skrev: Dear all, I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from MG Maestro (without any modification), and reloading the map directly from browser, the error disappears and the map is correctly shown. After saving the layout, there aren't differences in map and layout XML definitions. Have you any idea about? Thank you in advance. Fabio ___ 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/Create-programmatically-a-map-tp2314238p2320483.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] Create programmatically a map
Dear all, I have created programmatically a map (and its layout) using MG .Net web API. After creation, the new map and layout are visible in MG Maestro, and using the 'Show in browser button are correctly shown in browser. The problem happens when I load the map directly from browser, and the following error appears: The type 'OSGeo.MapGuide.MgNullArgumentException' in assembly 'MapGuideDotNetApi, Version= 2.0.2.30 11, Culture=neutral, PublicKeyToken=null' is not marked as serializable . Then, simply saving the new layout from MG Maestro (without any modification), and reloading the map directly from browser, the error disappears and the map is correctly shown. After saving the layout, there aren't differences in map and layout XML definitions. Have you any idea about? Thank you in advance. Fabio -- View this message in context: http://n2.nabble.com/Create-programmatically-a-map-tp2314238p2314238.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] Add new layer to map
You are right! Many thanks. Fabio sekko970 wrote: Dear all, I need to add a layer to my map from XML definition. This is my code: Public Sub CreateLater(ByVal sessionID As String, ByVal mapName As String, _ ByVal newLayerName As String, ByVal groupName As String) Dim userInfo As New MgUserInformation userInfo.SetMgSessionId(sessionID) Dim siteConn As New MgSiteConnection siteConn.Open(userInfo) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) Dim map As New MgMap() map.Open(resourceSrvc, mapName) 'Loading XML layer Dim newLayerXML As New XmlDocument newLayerXML.Load(Me.MapPath(NewLayer.xml)) 'Saving new layer in session repository Dim byteSource As New MgByteSource(Encoding.UTF8.GetBytes(newLayerXML.OuterXml), newLayerXML.OuterXml.Length) byteSource.SetMimeType(MgMimeType.Xml) Dim resID As New MgResourceIdentifier(Session: sessionID // newLayerName . MgResourceType.LayerDefinition) resourceSrvc.SetResource(resID, byteSource.GetReader(), Nothing) Dim newLayer As New MgLayerBase(resID, resourceSrvc) 'Add new layer to group Dim layerGroup As MgLayerGroup = Nothing If map.GetLayerGroups().Contains(groupName) Then layerGroup = map.GetLayerGroups.GetItem(groupName) Else layerGroup = New MgLayerGroup(groupName) layerGroup.SetVisible(True) layerGroup.SetDisplayInLegend(True) layerGroup.SetLegendLabel(groupName) map.GetLayerGroups.Add(layerGroup) End If newLayer.SetGroup(layerGroup) 'Insert new layer to map newLayer.SetName(newLayerName) newLayer.SetVisible(True) newLayer.SetLegendLabel(newLayerName) newLayer.SetDisplayInLegend(True) map.GetLayers.Insert(0, newLayer) map.Save(resourceSrvc) Saving the map, an MgNotImplementedException occurs. Where is my mistake? Thanks in advance for your help. Fabio -- View this message in context: http://n2.nabble.com/Add-new-layer-to-map-tp2186494p2191012.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] Add new layer to map
Dear Kenneth, I need your help for a second problem: I apparently save successfully the new layer into library repository (the legend and the map are correctly updated, and from MGStudio the new layer is visible in layers list), but in MGStudio 'Layer by group' view, my layer doesn't appear, so that when I reload the map, the new layer is lost (but it's present in MGStudio). Have you some idea? Thanks, Fabio sekko970 wrote: You are right! Many thanks. Fabio sekko970 wrote: Dear all, I need to add a layer to my map from XML definition. This is my code: Public Sub CreateLater(ByVal sessionID As String, ByVal mapName As String, _ ByVal newLayerName As String, ByVal groupName As String) Dim userInfo As New MgUserInformation userInfo.SetMgSessionId(sessionID) Dim siteConn As New MgSiteConnection siteConn.Open(userInfo) Dim resourceSrvc As MgResourceService = siteConn.CreateService(MgServiceType.ResourceService) Dim map As New MgMap() map.Open(resourceSrvc, mapName) 'Loading XML layer Dim newLayerXML As New XmlDocument newLayerXML.Load(Me.MapPath(NewLayer.xml)) 'Saving new layer in session repository Dim byteSource As New MgByteSource(Encoding.UTF8.GetBytes(newLayerXML.OuterXml), newLayerXML.OuterXml.Length) byteSource.SetMimeType(MgMimeType.Xml) Dim resID As New MgResourceIdentifier(Session: sessionID // newLayerName . MgResourceType.LayerDefinition) resourceSrvc.SetResource(resID, byteSource.GetReader(), Nothing) Dim newLayer As New MgLayerBase(resID, resourceSrvc) 'Add new layer to group Dim layerGroup As MgLayerGroup = Nothing If map.GetLayerGroups().Contains(groupName) Then layerGroup = map.GetLayerGroups.GetItem(groupName) Else layerGroup = New MgLayerGroup(groupName) layerGroup.SetVisible(True) layerGroup.SetDisplayInLegend(True) layerGroup.SetLegendLabel(groupName) map.GetLayerGroups.Add(layerGroup) End If newLayer.SetGroup(layerGroup) 'Insert new layer to map newLayer.SetName(newLayerName) newLayer.SetVisible(True) newLayer.SetLegendLabel(newLayerName) newLayer.SetDisplayInLegend(True) map.GetLayers.Insert(0, newLayer) map.Save(resourceSrvc) Saving the map, an MgNotImplementedException occurs. Where is my mistake? Thanks in advance for your help. Fabio -- View this message in context: http://n2.nabble.com/Add-new-layer-to-map-tp2186494p2191381.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