ThinkGeo.com    |     Documentation    |     Premium Support

Implement Caching with MsSqlFeatureLayer

Hi!

How can I implement cache with sqlserver?
I tried to do the following, but it did not work.

        strPath = System.Web.Hosting.HostingEnvironment.MapPath("~/tiles")

        loFileTileCache = New FileBitmapTileCache(strPath)
        loFileTileCache.TileAccessMode = TileAccessMode.ReadAddDelete
        loFileTileCache.ImageFormat = TileImageFormat.Png

           'Lineas 
            mssqlFeatureLayer = New MsSqlFeatureLayer(ConnectionStr, "mags.WEB_EL_v_Lineas", "Linea")

            mssqlFeatureLayer.Name = capa
            mssqlFeatureLayer.CustomGeometryColumnName = "Objeto"
            lo_LineaValueStyle.ColumnName = "Alimentador_MT"

            mssqlFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(lo_LineaValueStyle)
            mssqlFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
            mssqlFeatureLayer.FeatureSource.Projection = proj4



            layerOverlay.TileCache = loTileCache

            layerOverlay.Layers.Add(mssqlFeatureLayer)

And I get this error

“Object reference not set to an instance of an object.”
Thank you

Regards

Abel

Hi Abel,

Thanks for let us know this problem.

Your exception is easy to be fixed but after that some tiles cannot be saved correct, our developer is working for that and we will let you know after we complete it.

Regards,

Ethan

Hi Abel,

It had been fixed, please try the


or

And please let us know whether it works for you.

Regards,

Ethan