Hi,
I'm using MapWinGIS in an MS Access Application and trying to prefetch the tiles for a given region for all defined zoom levels.
The code is pretty simple:
'--- Getting the boundary into
'--- dblLongMax / dblLongMin
'--- dblLatMax / dblLatMin
MapMain.ProjToDegrees shpFile.Extents.xMax, shpFile.Extents.yMax, dblLongMax, dblLatMax
MapMain.ProjToDegrees shpFile.Extents.xMin, shpFile.Extents.yMin, dblLongMin, dblLatMin
'---- Initialize the StopInterface-Class
Set clsStopFunction = New StopInterface
clsStopFunction.Starten
'--- prefetching...
For intZoomRunner = intWMST_Min_Zoomlevel To intWMST_Max_Zoomlevel
lngResult = Me.MapMain.Tiles.Prefetch(dblYMin, dblYMax, dblXMin, dblXMax, intZoomRunner, lngWMST_CUSTOM_PROVIDER_ID, clsStopFunction)
next
'--------------------------------
My StopInterface-Class Definition looks like:
----------------------------------------------------
Option Compare Database
Option Explicit
Implements MapWinGIS.IStopExecution
Dim m_bolStop As Boolean
Private Sub Class_Initialize()
m_bolStop = True
End Sub
Private Sub Class_Terminate()
m_bolStop = True
End Sub
Private Function IStopExecution_StopFunction() As Boolean
IStopExecution_StopFunction = m_bolStop
End Function
Public Property Get doStop() As Boolean
doStop = m_bolStop
End Property
Public Property Let doStop(ByVal bolWert As Boolean)
m_bolStop = bolWert
End Property
Public Sub Stoppen()
m_bolStop = True
End Sub
Public Sub Starten()
m_bolStop = False
End Sub
--------------------------------------------
This worked more or less for 4.9.3.5 but after upgrading to 4.9.3.6 it get an error message saying:
Assertion failed: Invalid reference count for a tile
and at the third or fourth time when it hits the loop, MS access crashes completely.
This happens, independent of the zoomlevel (1 - 19) you enter.
Since there is no interaction to the tile reference count, - I'm stuck.
Any ideas what I'm doing wrong, or is this method simply broken in the current release?
Thanks in advance