Removing Thematic Layers

651 views
Skip to first unread message

ralph

unread,
Jul 2, 2010, 10:02:11 PM7/2/10
to MapInfo-L
Hi everybody,

If a particular table has several thematic layers associated with it,
how can you determine how many are there and how would you create a
loop to remove them in a Mapbasic application?

Thanks

Gentreau

unread,
Jul 3, 2010, 3:10:22 AM7/3/10
to mapi...@googlegroups.com

Hi, the code below will remove any layer name which you give it (if it
exists)
To remove a thematic layer add a "(" to the layer name.
Example to remove a thematic on the layer Streets pass "Streets(" to the sub


'============================================= REMOVE LAYERS
Sub Remove_layer (ByVal layer_name As String)
Dim num_layers, counter as Integer

num_layers = MapperInfo( FrontWindow(), MAPPER_INFO_LAYERS )

For counter = 1 To num_layers
If InStr( 1, LayerInfo( FrontWindow(), counter, LAYER_INFO_NAME ),
layer_name) > 0 Then
Remove Map Layer counter
Exit Sub
End If
Next

End Sub
'============================================= REMOVE LAYERS


HtH
Gentreau

Hi everybody,

Thanks

--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en


ralph

unread,
Jul 3, 2010, 7:35:53 AM7/3/10
to MapInfo-L
It works like a charm

Thanks so much Gentreau!
Reply all
Reply to author
Forward
0 new messages