Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

New Post: Looping over layers in map

$
0
0
get a map layer collection
Dim lyrs As IMapLayerCollection = map.Layers
or if you want only from a certain map group
Dim lyrs As IMapLayerCollection = mapgrp.Layers
then iterate through the collection and parse out each layer. note that if you have groups then you may have to iterate further
                    For Each lyr As ILayer In lyrs
                        If TypeOf lyr Is IMapLineLayer Then
                            Dim lineLyr As MapLineLayer = CType(lyr, MapLineLayer)
                            Debug.Print(lineLyr.LegendText)
                        End If
                    Next lyr

Viewing all articles
Browse latest Browse all 3973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>