RE: [mapguide-users] FDO Gdal raster problem
I'm afraid that this isn't fixed in 2.1 yet either. Haris is working on trying to figure this stuff out for one of his customers, and I'm working closely with him, as I'm seeing the problem too. Between this and the problem of TCP connections becoming exhausted, I'm a bit stuck. If anyone is interested in trying out some .dlls that improve the stability of rasters in 2.0.2 considerably, download the following, make backups of the versions in Server/bin, and then copy them in place (after stopping the server). http://www.jasonbirch.com/temp/mapguide_raster_patch_2.0.2.7z I'll be adding notes on the defects fixed or worked around in these files in the ticket below once Trac starts behaving. http://trac.osgeo.org/mapguide/ticket/462 Jason___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Help with joining tables please
That is correct the view likely won't indicate the key, but as long as the column is available to pick and you select it it should work. I don't think we support the other numeric datatypes for key columns although arguably tinyint and bigint should be candidates. Why float shows up as a key column candidate for the table is odd. Who would use a float as a key? I haven't worked as much with SQL Server 2008 so the behavior of the views is unfamiliar to me. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 5:08 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please I updated the FDO to 3.3.2 (I can see the SQL Server Spatial type now!), but I still cannot select the lat/lon fields. All but five of the columns are "keys". Each table in the database has primary keys, indexes, and one even has functions. (I'm not using any functions at this time.) I have the primary key from the first native table (before all the inner joins) selected (and always has been). As far as I can tell, the View doesn't indicate keys, is that right? Although in the designer it is clear which columns are keys. Okay, a little more digging, and I discovered those five columns are all data type "int". The other 34 are "tinyint", "bigint", "float", "datetime", and "varchar". Is there a connection here? Why isn't the "float" of my lat/lon being picked up in the View but it does as a native table? Tomorrow I'll start my view from one table and see if that works then build my query up to what I want. From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 4:30 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please The native table will need a primary key column in order to support selection as well as to provide a key for the view and support selection from the view. So what you should have is some column from Table A defined as a primary key. Include that column in the view. Ignore my last question. I got confused. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:44 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please All of my mapping works fine using the data I have in the database. The main table has GPS positions as a float as well as a SQL Server 2008 Geography column. I have used the lat/lon columns as point data on the map and themed very nicely. However, I need extra information from other other tables that will be used for more theming, extra info, highlighting roads that have speed violatations, etc. For some reason, the lat/lon columns are showing as "key" fields in Mag Guide Studio _only_ for the newly created view. In the View Designer, I have no keys set up for these columns in either the view OR the native table. I'm not quite sure what you mean in the last question. I am using the ODBC provider to connect to the database. I am not using the spatial provider for this layer. I use shape files uploaded to the repository to which the GPS points in my lat/lon columns line up along nicely. One thought occurs to me now, should I update the FDO? I am using the out-of-the-box version. I'll check if there is an updated version and try again. From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 3:29 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please What datatype is your GPS_LAT/LON fields? You have to click the Geometry check box (in Studio) in order to set the X and Y columns (these aren't key columns). So is your data just point data then and you are using the ODBC Provider for both sources? Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:07 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please Hi Dave, thank you for the suggestions. I am using a single database and trying to join tables within them. I agree that using a View is the best choice, because that also allows me to adjust time zones. The problem I'm having now is MapGuide Studio will NOT display my GPS_LAT and GPS_LON fields when setting up the geometry. Out of 39 columns, only five are selectable. One thing that appears different is for the native table, only two columns are listed as "key" fields and they are not the GPS_LAT/LON columns. My new view has almost all of the columns as a "key" field including the lat/lon columns. How can I move the
RE: [mapguide-users] Help with joining tables please
I updated the FDO to 3.3.2 (I can see the SQL Server Spatial type now!), but I still cannot select the lat/lon fields. All but five of the columns are "keys". Each table in the database has primary keys, indexes, and one even has functions. (I'm not using any functions at this time.) I have the primary key from the first native table (before all the inner joins) selected (and always has been). As far as I can tell, the View doesn't indicate keys, is that right? Although in the designer it is clear which columns are keys. Okay, a little more digging, and I discovered those five columns are all data type "int". The other 34 are "tinyint", "bigint", "float", "datetime", and "varchar". Is there a connection here? Why isn't the "float" of my lat/lon being picked up in the View but it does as a native table? Tomorrow I'll start my view from one table and see if that works then build my query up to what I want. _ From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 4:30 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please The native table will need a primary key column in order to support selection as well as to provide a key for the view and support selection from the view. So what you should have is some column from Table A defined as a primary key. Include that column in the view. Ignore my last question. I got confused. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:44 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please All of my mapping works fine using the data I have in the database. The main table has GPS positions as a float as well as a SQL Server 2008 Geography column. I have used the lat/lon columns as point data on the map and themed very nicely. However, I need extra information from other other tables that will be used for more theming, extra info, highlighting roads that have speed violatations, etc. For some reason, the lat/lon columns are showing as "key" fields in Mag Guide Studio _only_ for the newly created view. In the View Designer, I have no keys set up for these columns in either the view OR the native table. I'm not quite sure what you mean in the last question. I am using the ODBC provider to connect to the database. I am not using the spatial provider for this layer. I use shape files uploaded to the repository to which the GPS points in my lat/lon columns line up along nicely. One thought occurs to me now, should I update the FDO? I am using the out-of-the-box version. I'll check if there is an updated version and try again. _ From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 3:29 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please What datatype is your GPS_LAT/LON fields? You have to click the Geometry check box (in Studio) in order to set the X and Y columns (these aren't key columns). So is your data just point data then and you are using the ODBC Provider for both sources? Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:07 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please Hi Dave, thank you for the suggestions. I am using a single database and trying to join tables within them. I agree that using a View is the best choice, because that also allows me to adjust time zones. The problem I'm having now is MapGuide Studio will NOT display my GPS_LAT and GPS_LON fields when setting up the geometry. Out of 39 columns, only five are selectable. One thing that appears different is for the native table, only two columns are listed as "key" fields and they are not the GPS_LAT/LON columns. My new view has almost all of the columns as a "key" field including the lat/lon columns. How can I move the "key" fields to the selectable x, y columns? Darren _ From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 8:39 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Of course if both tables are in the same database instance you might get your DBA to create a view joining the two tables for you. The performance would be better. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: Wednesday, March 25, 2009 5:23 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please
RE: [mapguide-users] Help with joining tables please
The native table will need a primary key column in order to support selection as well as to provide a key for the view and support selection from the view. So what you should have is some column from Table A defined as a primary key. Include that column in the view. Ignore my last question. I got confused. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:44 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please All of my mapping works fine using the data I have in the database. The main table has GPS positions as a float as well as a SQL Server 2008 Geography column. I have used the lat/lon columns as point data on the map and themed very nicely. However, I need extra information from other other tables that will be used for more theming, extra info, highlighting roads that have speed violatations, etc. For some reason, the lat/lon columns are showing as "key" fields in Mag Guide Studio _only_ for the newly created view. In the View Designer, I have no keys set up for these columns in either the view OR the native table. I'm not quite sure what you mean in the last question. I am using the ODBC provider to connect to the database. I am not using the spatial provider for this layer. I use shape files uploaded to the repository to which the GPS points in my lat/lon columns line up along nicely. One thought occurs to me now, should I update the FDO? I am using the out-of-the-box version. I'll check if there is an updated version and try again. From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 3:29 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please What datatype is your GPS_LAT/LON fields? You have to click the Geometry check box (in Studio) in order to set the X and Y columns (these aren't key columns). So is your data just point data then and you are using the ODBC Provider for both sources? Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:07 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please Hi Dave, thank you for the suggestions. I am using a single database and trying to join tables within them. I agree that using a View is the best choice, because that also allows me to adjust time zones. The problem I'm having now is MapGuide Studio will NOT display my GPS_LAT and GPS_LON fields when setting up the geometry. Out of 39 columns, only five are selectable. One thing that appears different is for the native table, only two columns are listed as "key" fields and they are not the GPS_LAT/LON columns. My new view has almost all of the columns as a "key" field including the lat/lon columns. How can I move the "key" fields to the selectable x, y columns? Darren From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 8:39 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Of course if both tables are in the same database instance you might get your DBA to create a view joining the two tables for you. The performance would be better. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: Wednesday, March 25, 2009 5:23 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Can we assume your spatial data is in tableA and you are using a Spatial provider connection? For table B I would suggest using an ODBC connection via a DSN. You don't need the overhead of the spatial provider stuff for the joined table. The same should apply when joining to SDF. In almost all cases the join should use an ODBC connection to the secondary data. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Wednesday, March 25, 2009 4:47 PM To: 'MapGuide Users Mail List' Subject: [mapguide-users] Help with joining tables please Hello, I've been fighting with this for a while and need your help. I want to combine a few tables together and have that data available for themeing and viewing. Without attempting to join tables, the data loads without any problem. However, I have not been able to get tables joined. Using normal SQL Server 2008 "inner join tableB on tableA.location = tableB.location" is what I'm trying to do. Using the Autdesk Mapguide Studio, I click through, set up my joining tables exactly as I would in SQL. In the layer definition editor, I see the ne
RE: [mapguide-users] Help with joining tables please
All of my mapping works fine using the data I have in the database. The main table has GPS positions as a float as well as a SQL Server 2008 Geography column. I have used the lat/lon columns as point data on the map and themed very nicely. However, I need extra information from other other tables that will be used for more theming, extra info, highlighting roads that have speed violatations, etc. For some reason, the lat/lon columns are showing as "key" fields in Mag Guide Studio _only_ for the newly created view. In the View Designer, I have no keys set up for these columns in either the view OR the native table. I'm not quite sure what you mean in the last question. I am using the ODBC provider to connect to the database. I am not using the spatial provider for this layer. I use shape files uploaded to the repository to which the GPS points in my lat/lon columns line up along nicely. One thought occurs to me now, should I update the FDO? I am using the out-of-the-box version. I'll check if there is an updated version and try again. _ From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 3:29 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please What datatype is your GPS_LAT/LON fields? You have to click the Geometry check box (in Studio) in order to set the X and Y columns (these aren't key columns). So is your data just point data then and you are using the ODBC Provider for both sources? Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:07 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please Hi Dave, thank you for the suggestions. I am using a single database and trying to join tables within them. I agree that using a View is the best choice, because that also allows me to adjust time zones. The problem I'm having now is MapGuide Studio will NOT display my GPS_LAT and GPS_LON fields when setting up the geometry. Out of 39 columns, only five are selectable. One thing that appears different is for the native table, only two columns are listed as "key" fields and they are not the GPS_LAT/LON columns. My new view has almost all of the columns as a "key" field including the lat/lon columns. How can I move the "key" fields to the selectable x, y columns? Darren _ From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 8:39 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Of course if both tables are in the same database instance you might get your DBA to create a view joining the two tables for you. The performance would be better. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: Wednesday, March 25, 2009 5:23 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Can we assume your spatial data is in tableA and you are using a Spatial provider connection? For table B I would suggest using an ODBC connection via a DSN. You don't need the overhead of the spatial provider stuff for the joined table. The same should apply when joining to SDF. In almost all cases the join should use an ODBC connection to the secondary data. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Wednesday, March 25, 2009 4:47 PM To: 'MapGuide Users Mail List' Subject: [mapguide-users] Help with joining tables please Hello, I've been fighting with this for a while and need your help. I want to combine a few tables together and have that data available for themeing and viewing. Without attempting to join tables, the data loads without any problem. However, I have not been able to get tables joined. Using normal SQL Server 2008 "inner join tableB on tableA.location = tableB.location" is what I'm trying to do. Using the Autdesk Mapguide Studio, I click through, set up my joining tables exactly as I would in SQL. In the layer definition editor, I see the new attributes. Before doing anything else, I export the layer as XML and test my map. The map viewer doesn't stop showing the busy icon, the legend labels become question marks (?) and no data ever loads. If I disable the layer, all the other layers show quickly. I've tried using the same database connection, a different database connection, and a SDF imported from a shapefile. No method appears to work for me. Is there a proper way of setting up joining tables? Should I learn the XML syntax and do it manually? Thanks for your help, Darren __
RE: [mapguide-users] Tooltip value from object
Yes I use ODBC provider to connect at the MSSQL 2005 tables. Tomorrow morning I test the computed property from Studio and so I can answer at your question. Regards Matteo Are you using the ODBC provider then for the connection since you pointed out the Lat/Lon fields? It may be a bug with the ODBC provider. I understand your need to code it, however I was wondering if you tested it with Studio also. If that fails too it's likely a general bug. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 2:50 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Dave, my featuresource is a MSSQL 2005 table with LAT, LON fields Add a computed property via Studio is not a good solution for my case because I manage 10 projects with a total of 100 featuresource of this type and this function will work for all of those Thanks a lot Matteo What is the data format of the feature source SDF, SHP? It may be a bug. What if you make a copy of the existing feature source and add the computed property via Studio does that work? Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 1:33 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, if I change this code Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") with this one Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("ID"), "ID") where ID is a property of featuresource I haven't any error so I think that the problem is the computed property. Matteo I would do the following to better debug things. You should check that the objFeatureReader returned from the SelectFeatures call is not null before starting the .ReadNext. As well note that you don't appear to have set the filter either so you will likely get more than 1 record back from your data. You might also try the SelectFeatures without adding the computed property, but instead specify an existing known property and include the filter. This looks like it should work. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 11:13 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime
RE: [mapguide-users] Help with joining tables please
What datatype is your GPS_LAT/LON fields? You have to click the Geometry check box (in Studio) in order to set the X and Y columns (these aren't key columns). So is your data just point data then and you are using the ODBC Provider for both sources? Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Thursday, March 26, 2009 3:07 PM To: 'MapGuide Users Mail List' Subject: RE: [mapguide-users] Help with joining tables please Hi Dave, thank you for the suggestions. I am using a single database and trying to join tables within them. I agree that using a View is the best choice, because that also allows me to adjust time zones. The problem I'm having now is MapGuide Studio will NOT display my GPS_LAT and GPS_LON fields when setting up the geometry. Out of 39 columns, only five are selectable. One thing that appears different is for the native table, only two columns are listed as "key" fields and they are not the GPS_LAT/LON columns. My new view has almost all of the columns as a "key" field including the lat/lon columns. How can I move the "key" fields to the selectable x, y columns? Darren From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 8:39 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Of course if both tables are in the same database instance you might get your DBA to create a view joining the two tables for you. The performance would be better. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: Wednesday, March 25, 2009 5:23 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Can we assume your spatial data is in tableA and you are using a Spatial provider connection? For table B I would suggest using an ODBC connection via a DSN. You don't need the overhead of the spatial provider stuff for the joined table. The same should apply when joining to SDF. In almost all cases the join should use an ODBC connection to the secondary data. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Wednesday, March 25, 2009 4:47 PM To: 'MapGuide Users Mail List' Subject: [mapguide-users] Help with joining tables please Hello, I've been fighting with this for a while and need your help. I want to combine a few tables together and have that data available for themeing and viewing. Without attempting to join tables, the data loads without any problem. However, I have not been able to get tables joined. Using normal SQL Server 2008 "inner join tableB on tableA.location = tableB.location" is what I'm trying to do. Using the Autdesk Mapguide Studio, I click through, set up my joining tables exactly as I would in SQL. In the layer definition editor, I see the new attributes. Before doing anything else, I export the layer as XML and test my map. The map viewer doesn't stop showing the busy icon, the legend labels become question marks (?) and no data ever loads. If I disable the layer, all the other layers show quickly. I've tried using the same database connection, a different database connection, and a SDF imported from a shapefile. No method appears to work for me. Is there a proper way of setting up joining tables? Should I learn the XML syntax and do it manually? Thanks for your help, Darren ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Tooltip value from object
Are you using the ODBC provider then for the connection since you pointed out the Lat/Lon fields? It may be a bug with the ODBC provider. I understand your need to code it, however I was wondering if you tested it with Studio also. If that fails too it's likely a general bug. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 2:50 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Dave, my featuresource is a MSSQL 2005 table with LAT, LON fields Add a computed property via Studio is not a good solution for my case because I manage 10 projects with a total of 100 featuresource of this type and this function will work for all of those Thanks a lot Matteo What is the data format of the feature source SDF, SHP? It may be a bug. What if you make a copy of the existing feature source and add the computed property via Studio does that work? Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 1:33 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, if I change this code Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") with this one Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("ID"), "ID") where ID is a property of featuresource I haven't any error so I think that the problem is the computed property. Matteo I would do the following to better debug things. You should check that the objFeatureReader returned from the SelectFeatures call is not null before starting the .ReadNext. As well note that you don't appear to have set the filter either so you will likely get more than 1 record back from your data. You might also try the SelectFeatures without adding the computed property, but instead specify an existing known property and include the filter. This looks like it should work. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 11:13 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime.Second.ToString() Return dateTimeStr End If ElseIf intpropertyType = MgPropertyType.Double Then If isNull Then
RE: [mapguide-users] Help with joining tables please
Hi Dave, thank you for the suggestions. I am using a single database and trying to join tables within them. I agree that using a View is the best choice, because that also allows me to adjust time zones. The problem I'm having now is MapGuide Studio will NOT display my GPS_LAT and GPS_LON fields when setting up the geometry. Out of 39 columns, only five are selectable. One thing that appears different is for the native table, only two columns are listed as "key" fields and they are not the GPS_LAT/LON columns. My new view has almost all of the columns as a "key" field including the lat/lon columns. How can I move the "key" fields to the selectable x, y columns? Darren _ From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: March 26, 2009 8:39 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Of course if both tables are in the same database instance you might get your DBA to create a view joining the two tables for you. The performance would be better. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: Wednesday, March 25, 2009 5:23 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Can we assume your spatial data is in tableA and you are using a Spatial provider connection? For table B I would suggest using an ODBC connection via a DSN. You don't need the overhead of the spatial provider stuff for the joined table. The same should apply when joining to SDF. In almost all cases the join should use an ODBC connection to the secondary data. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Wednesday, March 25, 2009 4:47 PM To: 'MapGuide Users Mail List' Subject: [mapguide-users] Help with joining tables please Hello, I've been fighting with this for a while and need your help. I want to combine a few tables together and have that data available for themeing and viewing. Without attempting to join tables, the data loads without any problem. However, I have not been able to get tables joined. Using normal SQL Server 2008 "inner join tableB on tableA.location = tableB.location" is what I'm trying to do. Using the Autdesk Mapguide Studio, I click through, set up my joining tables exactly as I would in SQL. In the layer definition editor, I see the new attributes. Before doing anything else, I export the layer as XML and test my map. The map viewer doesn't stop showing the busy icon, the legend labels become question marks (?) and no data ever loads. If I disable the layer, all the other layers show quickly. I've tried using the same database connection, a different database connection, and a SDF imported from a shapefile. No method appears to work for me. Is there a proper way of setting up joining tables? Should I learn the XML syntax and do it manually? Thanks for your help, Darren ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Tooltip value from object
Dave, my featuresource is a MSSQL 2005 table with LAT, LON fields Add a computed property via Studio is not a good solution for my case because I manage 10 projects with a total of 100 featuresource of this type and this function will work for all of those Thanks a lot Matteo What is the data format of the feature source SDF, SHP? It may be a bug. What if you make a copy of the existing feature source and add the computed property via Studio does that work? Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 1:33 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, if I change this code Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") with this one Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("ID"), "ID") where ID is a property of featuresource I haven't any error so I think that the problem is the computed property. Matteo I would do the following to better debug things. You should check that the objFeatureReader returned from the SelectFeatures call is not null before starting the .ReadNext. As well note that you don't appear to have set the filter either so you will likely get more than 1 record back from your data. You might also try the SelectFeatures without adding the computed property, but instead specify an existing known property and include the filter. This looks like it should work. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 11:13 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime.Second.ToString() Return dateTimeStr End If ElseIf intpropertyType = MgPropertyType.Double Then If isNull Then Return "0" Else Return objFeatureReader.GetDouble(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Feature Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Int16 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt16(strpropertyName).ToString() End If
RE: [mapguide-users] Tooltip value from object
What is the data format of the feature source SDF, SHP? It may be a bug. What if you make a copy of the existing feature source and add the computed property via Studio does that work? Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 1:33 PM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, if I change this code Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") with this one Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("ID"), "ID") where ID is a property of featuresource I haven't any error so I think that the problem is the computed property. Matteo I would do the following to better debug things. You should check that the objFeatureReader returned from the SelectFeatures call is not null before starting the .ReadNext. As well note that you don't appear to have set the filter either so you will likely get more than 1 record back from your data. You might also try the SelectFeatures without adding the computed property, but instead specify an existing known property and include the filter. This looks like it should work. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 11:13 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime.Second.ToString() Return dateTimeStr End If ElseIf intpropertyType = MgPropertyType.Double Then If isNull Then Return "0" Else Return objFeatureReader.GetDouble(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Feature Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Int16 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt16(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int32 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt32(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropert
RE: [mapguide-users] Tooltip value from object
Hi Dave, if I change this code Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") with this one Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("ID"), "ID") where ID is a property of featuresource I haven't any error so I think that the problem is the computed property. Matteo I would do the following to better debug things. You should check that the objFeatureReader returned from the SelectFeatures call is not null before starting the .ReadNext. As well note that you don't appear to have set the filter either so you will likely get more than 1 record back from your data. You might also try the SelectFeatures without adding the computed property, but instead specify an existing known property and include the filter. This looks like it should work. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 11:13 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime.Second.ToString() Return dateTimeStr End If ElseIf intpropertyType = MgPropertyType.Double Then If isNull Then Return "0" Else Return objFeatureReader.GetDouble(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Feature Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Int16 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt16(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int32 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt32(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int64 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt64(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Raster Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Single Then If
RE: [mapguide-users] Tooltip value from object
I would do the following to better debug things. You should check that the objFeatureReader returned from the SelectFeatures call is not null before starting the .ReadNext. As well note that you don't appear to have set the filter either so you will likely get more than 1 record back from your data. You might also try the SelectFeatures without adding the computed property, but instead specify an existing known property and include the filter. This looks like it should work. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 11:13 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime.Second.ToString() Return dateTimeStr End If ElseIf intpropertyType = MgPropertyType.Double Then If isNull Then Return "0" Else Return objFeatureReader.GetDouble(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Feature Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Int16 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt16(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int32 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt32(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int64 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt64(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Raster Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Single Then If isNull Then Return "null" Else Return objFeatureReader.GetSingle(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.String Then If isNull Then Return "null" Else Return objFeatureReader.GetString(strpropertyName) End If Else Return "
RE: [mapguide-users] Tooltip value from object
Hi Dave, this is my code: Dim objQueryOptions As MgFeatureQueryOptions = New MgFeatureQueryOptions() Dim strTooltipExpression as string= ="Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) )" objQueryOptions.AddComputedProperty("thetooltip", strTooltipExpression ) Dim objFeatureReader As MgFeatureReader objFeatureReader = objFeatureServ.SelectFeatures(New MgResourceIdentifier(objLayer.GetFeatureSourceId), objLayer.GetFeatureClassName, objQueryOptions) While objFeatureReader.ReadNext() Dim strTooltipValue as string=GetValueFromReader(objFeatureReader, objFeatureReader.GetPropertyType("thetooltip"), "thetooltip") ' I get the error on this line of code End While GetValueFromReader function is a my function that return the property value. This is the function code: Function GetValueFromReader(ByVal objFeatureReader As MgReader, ByVal intpropertyType As Integer, ByVal strpropertyName As String) As String Dim isNull As Boolean = objFeatureReader.IsNull(strpropertyName) If intpropertyType = MgPropertyType.Boolean Then If isNull Then Return "null" Else Return objFeatureReader.GetBoolean(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Byte Then If isNull Then Return "null" Else Return objFeatureReader.GetByte(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Clob Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.DateTime Then Dim dateTimeStr As String = Nothing If isNull Then Return "null" Else Dim aDateTime As MgDateTime = objFeatureReader.GetDateTime(strpropertyName) dateTimeStr = aDateTime.Month.ToString() + "."c + aDateTime.Day.ToString() + "."c + aDateTime.Year.ToString() + ":"c + aDateTime.Hour.ToString() + ":"c + aDateTime.Minute.ToString() + ":"c + aDateTime.Second.ToString() Return dateTimeStr End If ElseIf intpropertyType = MgPropertyType.Double Then If isNull Then Return "0" Else Return objFeatureReader.GetDouble(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Feature Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Int16 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt16(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int32 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt32(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Int64 Then If isNull Then Return "0" Else Return objFeatureReader.GetInt64(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.Raster Then If isNull Then Return "null" Else Return "notNull" End If ElseIf intpropertyType = MgPropertyType.Single Then If isNull Then Return "null" Else Return objFeatureReader.GetSingle(strpropertyName).ToString() End If ElseIf intpropertyType = MgPropertyType.String Then If isNull Then Return "null" Else Return objFeatureReader.GetString(strpropertyName) End If Else Return "" End If End Function Regards, Matteo Can you show a larger block of code? It seems like something else is wrong after you add the computed property to the QueryFeatureOptions object. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 6:19 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, the Response.Write("Computed Property index: " + result.ToString()); expression return to me "1". So I think that 1 property is add but when I try to get the property values MG give me this error "OSGeo.MapGuide.MgObjectNotFoundException: The specified object was not found"
Re: [mapguide-users] Modify mapdefinition in a layout
Hi alucas, you have very luck because it seems that i have problem in my C# code or perhaps in my configuration of mapguide server. Hi I provide the end user with a link to my special page (see the code1). In that page i redirect to the MapGuide viewer files (Response.Redirect). code1: The fonction SetLayout Map modify the mapdefinition in my layout. See image here : The problem : the layout is not modify and i have this message : An exception occurred in the XML parser. Have you an idea ? Thanks Hello, this code works well for me (PHP): function changeWebLayout($rs, $WebLayoutResId, $newMapResId, $s) { try { // Obtenemos el contenido del WebLayout en XML $byteReader = $rs->GetResourceContent($WebLayoutResId); $xml = $byteReader->ToString(); $doc = DOMDocument::loadXML($xml); // Accedemos al nodo que queremos $wl = $doc->getElementsByTagName("ResourceId"); $mapResIdNode = $wl->item(0); $mapResIdNode->nodeValue = $newMapResId->ToString(); $strXML = $doc->saveXML(); //header('content-type: text/xml'); $byteSource = new MgByteSource($strXML, strlen($strXML)); $byteSource->SetMimeType(MgMimeType::Xml); // Modificamos el repositorio $rs->SetResource($WebLayoutResId, $byteSource->GetReader(), null); } catch (MgException $e) { echo $e->GetDetails(); } -- View this message in context: http://n2.nabble.com/Modify-mapdefinition-in-a-layout-tp2462320p2539187.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] What is %24CurrentSelection???
Hi Achectl, It is encouraging that it got that far before it failed this time. In the code below, you've commented out the original call to get the selection from the map, and instead retrieve it from the $selectionXml parameter. I don't see this defined anywhere, which is presumably why it fails. Try changing this: // Retrieve the selection $selection = new MgSelection($map, $selectionXml); //$selection = new MgSelection(); //$selection->Open($resourceService, $mapName); To this: // Retrieve the selection $selection = new MgSelection(); $selection->Open($resourceService, $mapName); $selectionXml = $selection->ToXml(); Chris. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of achectl Sent: Thursday, March 26, 2009 3:33 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] What is %24CurrentSelection??? Hi Chris, I've tried to follow your script and try to modify a little of date.php as below: Open($user); // Create a resource service instance $resourceService = $siteConnection->CreateService(0); // Retrieve the selection $selection = new MgSelection($map, $selectionXml); //$selection = new MgSelection(); //$selection->Open($resourceService, $mapName); // Output the selection echo $selection->ToXml(); } catch(MgException $e) { // Output error details echo "" . $e->GetMessage() . ""; echo "" . $e->GetDetails() . ""; } function GetParameters($params) { global $mapName; global $sessionId; global $ID; global $Area; $mapName = $params['MAPNAME']; $sessionId = $params['SESSION']; $ID = $params['ID']; $Area = $params['Area']; echo $mapName; echo $ID; echo $Area; } function GetRequestParameters() { if($_SERVER['REQUEST_METHOD'] == "POST") GetParameters($_POST); else GetParameters($_GET); } ?> After click the invokeURL command of the fusion layout, it prompts the error "Default49cb4916a1dfe$CurrentSelection$CurrentSelectionAn unclassified exception occurred.An unclassified exception occurred. Exception occurred in method new_MgSelection at line 12308 in file .\MgApi_wrap.cpp" of the new date.php window. The $ID & $Area is the key of the invokeURL.js. It seems that the proper value still can't to find! I think it should be something missing of the date.php. Thanks Achectl If your date.php file is on a separate server, it seems like a good idea to save the sample code in a local file, as you've done, and then make that script issue a subsequent request to date.php. It looks like the SESSION parameter is not getting sent to your script. It could be a case issue - it might get sent as lowercase 'session' instead. Are you able to use Fiddler or Firebug to determine which parameters are actually getting sent to your script? I also remember seeing a defect where the parameters got sent twice, which caused problems. If your InvokeUrl.js (in the fusion/widgets folder) contains a section like this: execute : function() { var url = this.sBaseUrl; //add in other parameters to the url here var map = this.getMap(); var params = []; params.push('LOCALE='+Fusion.locale); params.push('SESSION='+map.getSessionID()); params.push('MAPNAME='+map.getMapName()); params = params.concat(this.additionalParameters); try changing it to: execute : function() { var url = this.sBaseUrl; //add in other parameters to the url here var map = this.getMap(); var taskPaneTarget = Fusion.getWidgetById(this.sTarget); var params = []; if ( taskPaneTarget == null ) { params.push('LOCALE='+Fusion.locale); params.push('SESSION='+map.getSessionID()); params.push('MAPNAME='+map.getMapName()); } params = params.concat(this.additionalParameters); An alternative approach would be to fix the InvokeUrl.js file so that it handles the $CurrentSelection variable correctly, but that would require a bit of figuring out. Chris. -- View this message in context: http://n2.nabble.com/What-is--24CurrentSelectiontp2490302p2537430.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/
Re: [mapguide-users] Modify mapdefinition in a layout
Hi, Yes, the browser can read the xml file : i have generate 2 files : one just after reading the doc ( http://patxi.mayol.free.fr/test_before.xml ) and another one after modify the Map id ( http://patxi.mayol.free.fr/test_after.xml ) : the 2 files an be reading in my browser . You can see my code here : http://patxi.mayol.free.fr/sample3.asp regards Even if you don't have any xsd files in c:\temp, you should be able to open the xml document using Internet Explorer (just drag it into it). Have you tried to not change the xml, and just save it back to MapGuide after reading it? (In your code, just comment out the part that writes the new Map id into the xml.) Regards, Kenneth Skovhede, GEOGRAF A/S euskalmap skrev: > HI, > > Yes i have the file WebLayout-1.0.0.xsd in the directory C:\Program > Files\MapGuideOpenSource2.0\Server\Schema\. > which method you want that I use to save the weblayout ? > If i save the weblayout in my code with the instruction , > FileStream fs = File.Create("c:\\temp\\test.xml"); > fs.Write(encodedBytes, 0, encodedBytes.Length); > it is normal that i can not read the weblayout because the file > WebLayout-1.0.0.xsd is not present in c:\temp directory. > I have not understand how saving and reading the weblayout ? > Other question : Perhaps my mapguide server is not correctly parameterized? > Thanks for your lelp. > > > Yes, it is very strange that it happens with only weblayouts. > Do you have the file: > C:\Program Files\MapGuideOpenSource2.0\Server\Schema\WebLayout-1.0.0.xsd > > Can you save the weblayout if you just read it, and then save it? (eg. > not changing anything). > > Regards, Kenneth Skovhede, GEOGRAF A/S > > > > euskalmap skrev: > >> Hi, >> I have try your maestro class in my sample like this : >> http://patxi.mayol.free.fr/sample2.asp >> http://patxi.mayol.free.fr/sample2.asp >> I have always the same error. >> In the mapguide log file it say 'An exception occurred in the XML parser.' >> and at the end i say about an error in >> MgResourceContentManager.ValidateDocument. >> Perhaps, Mapguide server can not find the WebLayout.1.0.0.xsd file ? >> What you think about it?. >> NB:It is very strange that there is no problem with filter in layer and as >> much problem to modify mapdefinition in layout !!! >> >> Thanks >> >> >> >> > ___ > 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/Modify-mapdefinition-in-a-layout-tp2462320p2539006.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] Modify mapdefinition in a layout
Hi I provide the end user with a link to my special page (see the code1). In that page i redirect to the MapGuide viewer files (Response.Redirect). code1: The fonction SetLayout Map modify the mapdefinition in my layout. See image here : The problem : the layout is not modify and i have this message : An exception occurred in the XML parser. Have you an idea ? Thanks Hello, this code works well for me (PHP): function changeWebLayout($rs, $WebLayoutResId, $newMapResId, $s) { try { // Obtenemos el contenido del WebLayout en XML $byteReader = $rs->GetResourceContent($WebLayoutResId); $xml = $byteReader->ToString(); $doc = DOMDocument::loadXML($xml); // Accedemos al nodo que queremos $wl = $doc->getElementsByTagName("ResourceId"); $mapResIdNode = $wl->item(0); $mapResIdNode->nodeValue = $newMapResId->ToString(); $strXML = $doc->saveXML(); //header('content-type: text/xml'); $byteSource = new MgByteSource($strXML, strlen($strXML)); $byteSource->SetMimeType(MgMimeType::Xml); // Modificamos el repositorio $rs->SetResource($WebLayoutResId, $byteSource->GetReader(), null); } catch (MgException $e) { echo $e->GetDetails(); } -- View this message in context: http://n2.nabble.com/Modify-mapdefinition-in-a-layout-tp2462320p2538960.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] Tooltip value from object
Can you show a larger block of code? It seems like something else is wrong after you add the computed property to the QueryFeatureOptions object. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, March 26, 2009 6:19 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, the Response.Write("Computed Property index: " + result.ToString()); expression return to me "1". So I think that 1 property is add but when I try to get the property values MG give me this error "OSGeo.MapGuide.MgObjectNotFoundException: The specified object was not found". I call my property with this name "thetooltip" and the property expression is: Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) ) I can't modify the featuresource because is used from another program Regards, Matteo So I'm guessing in your code you have something like: result=mgFeatQueryOptions.AddComputedProperty(computedPropAlias, computedProp); So what if you add a debug statement after it to do something like echo the following: Response.Write("Computed Property index: " + result.ToString()); An alternative to trying to do this in code might be to edit the feature source and add the computed property there. Create your layer using the extended feature class and in your code you can just select this property without having to do the computed property bit, but if there is something wrong with the expression you have maybe that is causing the computed property to actually get added. I wouldn't call it tooltip by the way as that seems too much like a keyword. I would call it theToolTip or something to be safe. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Wednesday, March 25, 2009 10:57 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, now I get the tooltip expression from Layer definition and I add a computed property on MgFeatureQueryOptions. I have used "tooltip" alias. However when I try to read the tooltip property mapguide not find it on property collection. Can you help me? Regards, Matteo Can you parse the layer definition to get the expression and execute a query using the expression as the select statement with the addition of a feature id or key value? Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Tuesday, March 24, 2009 11:39 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Tooltip value from object Hi All, I need to get the tooltip value from a single object of a layer. In the layer definition the tooltip is an expression. I develop with MG 2.0.2 and ASP.NET Have any ideas? Regards, Matteo -- View this message in context: http://n2.nabble.com/Tooltip-value-from-object-tp2528017p2528017.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/Tooltip-value-from-object-tp2528017p2533619.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/Tooltip-value-from-object-tp2528017p2538007.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Help with joining tables please
Of course if both tables are in the same database instance you might get your DBA to create a view joining the two tables for you. The performance would be better. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Dave Wilson Sent: Wednesday, March 25, 2009 5:23 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Help with joining tables please Can we assume your spatial data is in tableA and you are using a Spatial provider connection? For table B I would suggest using an ODBC connection via a DSN. You don't need the overhead of the spatial provider stuff for the joined table. The same should apply when joining to SDF. In almost all cases the join should use an ODBC connection to the secondary data. Dave From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Darren Karasiuk Sent: Wednesday, March 25, 2009 4:47 PM To: 'MapGuide Users Mail List' Subject: [mapguide-users] Help with joining tables please Hello, I've been fighting with this for a while and need your help. I want to combine a few tables together and have that data available for themeing and viewing. Without attempting to join tables, the data loads without any problem. However, I have not been able to get tables joined. Using normal SQL Server 2008 "inner join tableB on tableA.location = tableB.location" is what I'm trying to do. Using the Autdesk Mapguide Studio, I click through, set up my joining tables exactly as I would in SQL. In the layer definition editor, I see the new attributes. Before doing anything else, I export the layer as XML and test my map. The map viewer doesn't stop showing the busy icon, the legend labels become question marks (?) and no data ever loads. If I disable the layer, all the other layers show quickly. I've tried using the same database connection, a different database connection, and a SDF imported from a shapefile. No method appears to work for me. Is there a proper way of setting up joining tables? Should I learn the XML syntax and do it manually? Thanks for your help, Darren ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Modify mapdefinition in a layout
Even if you don't have any xsd files in c:\temp, you should be able to open the xml document using Internet Explorer (just drag it into it). Have you tried to not change the xml, and just save it back to MapGuide after reading it? (In your code, just comment out the part that writes the new Map id into the xml.) Regards, Kenneth Skovhede, GEOGRAF A/S euskalmap skrev: HI, Yes i have the file WebLayout-1.0.0.xsd in the directory C:\Program Files\MapGuideOpenSource2.0\Server\Schema\. which method you want that I use to save the weblayout ? If i save the weblayout in my code with the instruction , FileStream fs = File.Create("c:\\temp\\test.xml"); fs.Write(encodedBytes, 0, encodedBytes.Length); it is normal that i can not read the weblayout because the file WebLayout-1.0.0.xsd is not present in c:\temp directory. I have not understand how saving and reading the weblayout ? Other question : Perhaps my mapguide server is not correctly parameterized? Thanks for your lelp. Yes, it is very strange that it happens with only weblayouts. Do you have the file: C:\Program Files\MapGuideOpenSource2.0\Server\Schema\WebLayout-1.0.0.xsd Can you save the weblayout if you just read it, and then save it? (eg. not changing anything). Regards, Kenneth Skovhede, GEOGRAF A/S euskalmap skrev: Hi, I have try your maestro class in my sample like this : http://patxi.mayol.free.fr/sample2.asp http://patxi.mayol.free.fr/sample2.asp I have always the same error. In the mapguide log file it say 'An exception occurred in the XML parser.' and at the end i say about an error in MgResourceContentManager.ValidateDocument. Perhaps, Mapguide server can not find the WebLayout.1.0.0.xsd file ? What you think about it?. NB:It is very strange that there is no problem with filter in layer and as much problem to modify mapdefinition in layout !!! Thanks ___ 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] FDO Gdal raster problem
Hi folks, I'm using tiled tiffs in my map. After some paning and zooming around i'm not able to continue work with the map. The server proces is still running but the map is caught in an endless loading loop. The log file contains the following error: Cannot create any more connections to the OSGeo.Gdal FDO provider. I found some information here , but this didn't helped me. http://trac.osgeo.org/mapguide/ticket/462 I hope this will be fixed in the upcoming release of mapguide, but is there any work-around by now? Any help would be appreciated! -- View this message in context: http://n2.nabble.com/FDO-Gdal-raster-problem-tp2538452p2538452.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] Tooltip value from object
Hi Dave, the Response.Write("Computed Property index: " + result.ToString()); expression return to me "1". So I think that 1 property is add but when I try to get the property values MG give me this error "OSGeo.MapGuide.MgObjectNotFoundException: The specified object was not found". I call my property with this name "thetooltip" and the property expression is: Concat ( 'Nome Sito: ' , Concat ( NOME_SITO , Concat ( '\nCodice Sito: ' , Concat ( SITENUMBER , Concat ( '\nSrambling Code: ' , SCRAMBLING_CODE ) ) ) ) ) I can't modify the featuresource because is used from another program Regards, Matteo So I'm guessing in your code you have something like: result=mgFeatQueryOptions.AddComputedProperty(computedPropAlias, computedProp); So what if you add a debug statement after it to do something like echo the following: Response.Write("Computed Property index: " + result.ToString()); An alternative to trying to do this in code might be to edit the feature source and add the computed property there. Create your layer using the extended feature class and in your code you can just select this property without having to do the computed property bit, but if there is something wrong with the expression you have maybe that is causing the computed property to actually get added. I wouldn't call it tooltip by the way as that seems too much like a keyword. I would call it theToolTip or something to be safe. Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Wednesday, March 25, 2009 10:57 AM To: mapguide-users@lists.osgeo.org Subject: RE: [mapguide-users] Tooltip value from object Hi Dave, now I get the tooltip expression from Layer definition and I add a computed property on MgFeatureQueryOptions. I have used "tooltip" alias. However when I try to read the tooltip property mapguide not find it on property collection. Can you help me? Regards, Matteo Can you parse the layer definition to get the expression and execute a query using the expression as the select statement with the addition of a feature id or key value? Dave -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Tuesday, March 24, 2009 11:39 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Tooltip value from object Hi All, I need to get the tooltip value from a single object of a layer. In the layer definition the tooltip is an expression. I develop with MG 2.0.2 and ASP.NET Have any ideas? Regards, Matteo -- View this message in context: http://n2.nabble.com/Tooltip-value-from-object-tp2528017p2528017.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/Tooltip-value-from-object-tp2528017p2533619.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/Tooltip-value-from-object-tp2528017p2538007.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] What is %24CurrentSelection???
Hi Chris, I've tried to follow your script and try to modify a little of date.php as below: Open($user); // Create a resource service instance $resourceService = $siteConnection->CreateService(0); // Retrieve the selection $selection = new MgSelection($map, $selectionXml); //$selection = new MgSelection(); //$selection->Open($resourceService, $mapName); // Output the selection echo $selection->ToXml(); } catch(MgException $e) { // Output error details echo "" . $e->GetMessage() . ""; echo "" . $e->GetDetails() . ""; } function GetParameters($params) { global $mapName; global $sessionId; global $ID; global $Area; $mapName = $params['MAPNAME']; $sessionId = $params['SESSION']; $ID = $params['ID']; $Area = $params['Area']; echo $mapName; echo $ID; echo $Area; } function GetRequestParameters() { if($_SERVER['REQUEST_METHOD'] == "POST") GetParameters($_POST); else GetParameters($_GET); } ?> After click the invokeURL command of the fusion layout, it prompts the error "Default49cb4916a1dfe$CurrentSelection$CurrentSelectionAn unclassified exception occurred.An unclassified exception occurred. Exception occurred in method new_MgSelection at line 12308 in file .\MgApi_wrap.cpp" of the new date.php window. The $ID & $Area is the key of the invokeURL.js. It seems that the proper value still can't to find! I think it should be something missing of the date.php. Thanks Achectl If your date.php file is on a separate server, it seems like a good idea to save the sample code in a local file, as you've done, and then make that script issue a subsequent request to date.php. It looks like the SESSION parameter is not getting sent to your script. It could be a case issue - it might get sent as lowercase 'session' instead. Are you able to use Fiddler or Firebug to determine which parameters are actually getting sent to your script? I also remember seeing a defect where the parameters got sent twice, which caused problems. If your InvokeUrl.js (in the fusion/widgets folder) contains a section like this: execute : function() { var url = this.sBaseUrl; //add in other parameters to the url here var map = this.getMap(); var params = []; params.push('LOCALE='+Fusion.locale); params.push('SESSION='+map.getSessionID()); params.push('MAPNAME='+map.getMapName()); params = params.concat(this.additionalParameters); try changing it to: execute : function() { var url = this.sBaseUrl; //add in other parameters to the url here var map = this.getMap(); var taskPaneTarget = Fusion.getWidgetById(this.sTarget); var params = []; if ( taskPaneTarget == null ) { params.push('LOCALE='+Fusion.locale); params.push('SESSION='+map.getSessionID()); params.push('MAPNAME='+map.getMapName()); } params = params.concat(this.additionalParameters); An alternative approach would be to fix the InvokeUrl.js file so that it handles the $CurrentSelection variable correctly, but that would require a bit of figuring out. Chris. -- View this message in context: http://n2.nabble.com/What-is--24CurrentSelectiontp2490302p2537430.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] Error Webstudio ...
Ok..Ok.. :( - [ http://www.myguidepages.com Click My Website ][ http://www.easy-share.com/f/1325981887/GIS My Collection GIS ][ http://www.easy-share.com/f/1325975362/mp3 My Collection MP3 ][ http://www.easy-share.com/f/1325973905/Free Ebook My Collection Ebook ] -- View this message in context: http://n2.nabble.com/Error-Webstudio-...-tp2536896p2537073.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] Error Webstudio ...
Ajid, please remove those links from your signature because these aren't really appropriate. NHF. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of ajid Sent: Thursday, March 26, 2009 8:51 AM To: mapguide-users@lists.osgeo.org Subject: Re: [mapguide-users] Error Webstudio ... - [ http://www.myguidepages.com Click My Website ][ http://www.easy-share.com/f/1325981887/GIS My Collection GIS ][ http://www.easy-share.com/f/1325975362/mp3 My Collection MP3 ][ http://www.easy-share.com/f/1325973905/Free Ebook My Collection Ebook ] ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Error Webstudio ...
maestro - [ http://www.myguidepages.com Click My Website ][ http://www.easy-share.com/f/1325981887/GIS My Collection GIS ][ http://www.easy-share.com/f/1325975362/mp3 My Collection MP3 ][ http://www.easy-share.com/f/1325973905/Free Ebook My Collection Ebook ] -- View this message in context: http://n2.nabble.com/Error-Webstudio-...-tp2536896p2537048.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