Hi,
We are using Thinkgeo 7.0.0.0 Web Edition to draw features of a layer on a ASP .NET Web Application. We’ve configured an MsSql2008FeatureLayer to read features from a SQL SERVER view. The view does not returns any row because there are no rows on the underneath SQL SERVER tables. If we add this layer to a map, we receive a error message with the following message “Unable to cast object of type ‘System.DBNull’ to type ‘System.Byte[]’.”.
The stack trace is:
at ThinkGeo.MapSuite.Core.MsSql2008FeatureSource.4j4=(RectangleShape 4z4=, QueryType 5D4=, IEnumerable`1 5T4=)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.WebEdition.LayerOverlay.DrawCore(GeoCanvas canvas, Object nativeImage, RectangleShape canvasExtent, GeographyUnit mapUnit)
at AmbiSIG.GeoPortal.Web.Map.TG.ThinkGeoExtensions.AmbiSIGLayerOverlay.DrawCore(GeoCanvas canvas, Object nativeImage, RectangleShape canvasExtent, GeographyUnit mapUnit) in c:\projectos\GeoPortal\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\ThinkGeoExtensions\AmbiSIGLayerOverlay.cs:line 142
at ThinkGeo.MapSuite.WebEdition.LayerOverlay.Draw(GeoCanvas canvas, Object nativeImage, RectangleShape canvasExtent, GeographyUnit mapUnit)
at ThinkGeo.MapSuite.WebEdition.SingleThreadTileResource.1xc=(Bitmap 2Bc=)
at ThinkGeo.MapSuite.WebEdition.SingleThreadTileResource.1Rc=(Bitmap 1hc=)
at ThinkGeo.MapSuite.WebEdition.SingleThreadTileResource.0Rc=(HttpContext 0hc=)
It seems like the exception is thrown after the execution of the following SQL statement:
DECLARE @polygon01 geometry
SELECT TOP 1 @polygon01 = geometry::STGeomFromWKB(geom.STAsBinary(),4326) FROM <view_name> WHERE 1=1 AND <filter>
SELECT @polygon01 = @polygon01.STUnion(geometry::STGeomFromWKB(geom.STAsBinary(),4326).STEnvelope()).STEnvelope() FROM <view_name> WHERE 1=1 AND <filter>
SELECT @polygon01.STAsBinary();
Is there anything we can do to avoid this error. If there are no features to draw on the layer, that shouldn’t cause an error. It should return a transparent image without any error message.
We would also like to know if it’s possible to return HTTP 500 response error messages indicating that happened a server side error. Actually it returns a HTTP 200 response message independently of the DrawingExceptionMode configured on the layer.
Best Regards,
Bdaf
Exception while trying to draw features
Hi Bdaf,
I have fixed this bug from the version 7.0.339.0. you can download it from here:
Full edition: ap.thinkgeo.com:5001/fbsharing/RqTCepuf
Eval edition: ap.thinkgeo.com:5001/fbsharing/12p2z6WE
Thanks,
Hi,
We’ve tried that new version and seems like YahooOverlay completely disappeared from the assembly!?
We use that overlay on our code.
It should happen on the same version of the MapSuite?
Best Regards,
BdaF
Hi BdaF,
Yahoo API have been closed till September 13, 2011, so we have removed YahooOverlay, you can see the information here:
developer.yahoo.com/maps/
developer.yahoo.com/maps/ajax/
It said: "We are shutting down this service on September 13, 2011. We suggest using maps from our partner Nokia. Please visit developer.here.net for more information."
If you need a background layer, please choose Bing map or Google map instead.
If you need to use Here map, please contact our sales for professional service.
Regards,
Don
Hi Don,
Thanks for the information.
The only thing that I’m not used to, is a class definition being removed from the same major version of a software or API.
We will cope with that.
Thanks,
BdaF
Hi BadF,
I am sorry that take trouble to you and thanks for your understanding, because the 3rd part service had been stopped so we cannot set it as obsoleted then remove it in next release, but for our other APIs we handle it follow this progress.
Regards,
Don