Hello again,
sorry for writing again, hope I won't fill up the discussions alone ...
I now proceeded very far. I'd now like to rewrite the (vba-) code for dynamic visibility of layers, which is in my current version quit complicated. So I tried the following code, but as written in a previous thread, the layer is never displayed. It should apear when the zoom level reaches 1:3000 and should disappear again if zoomed out (e.g. 1:3500).
sorry for writing again, hope I won't fill up the discussions alone ...
I now proceeded very far. I'd now like to rewrite the (vba-) code for dynamic visibility of layers, which is in my current version quit complicated. So I tried the following code, but as written in a previous thread, the layer is never displayed. It should apear when the zoom level reaches 1:3000 and should disappear again if zoomed out (e.g. 1:3500).
Set objText = New MapWinGIS.Shapefile
If objText.Open(Application.CurrentProject.Path & "\texte.shp") = True Then
objText.Labels.FontName = "Arial"
objText.Labels.FontSize = 6
objText.Labels.FrameVisible = False
' Shape-Objekt durchlaufen
For i = 0 To objText.NumShapes - 1
' Label-Text ermitteln
strLabel = CStr(objText.CellValue(6, i))
' Label-Koordinaten ermitteln
dblX = objText.Shape(i).Point(0).x
dblY = objText.Shape(i).Point(0).y
objText.Labels.AddLabel strLabel, dblX, dblY
Next i
intLayerHandle = Me.mapMain.AddLayer(objText, True)
' set dynamic visibility
Me.mapMain.LayerDynamicVisibility(intLayerHandle) = True
Me.mapMain.LayerMinVisibleScale(intLayerHandle) = 3000
Me.mapMain.LayerMaxVisibleScale(intLayerHandle) = 0
Me.mapMain.ShapeLayerPointSize(intLayerHandle) = 2
End If
Thanks again