VectorLayer display using advanced layer creation methods¶

Experiment with creation of single symbol, categorized or graduated legends for a VectorLayer

In [ ]:
map = Map()
map

Create a VectorLayer and generate a single symbol legend

In [ ]:
v = inter.VectorLayer("nuts1").opacity(255)
v.legendSet('line','stroke','#000000')
v.legendSet('line','stroke-width','0.25')
v.legendSingle("#ff0000")
map.clear()  
tlayer = map.addLayer(v.toLayer())

Create a legend on all disting values of an alphanumeric attribute (ICC which contains the country code for each polygon) and use different color schemes

In [ ]:
v = inter.VectorLayer("nuts1").opacity(255)
v.legendSet('line','stroke','#010000')
v.legendSet('line','stroke-width','0.5')
#v.colorScheme("YlOrBr_discrete")
#v.colorScheme("random",10)
v.legendCategories("ICC")
map.clear()  
tlayer = map.addLayer(v.toLayer())

Create a graduated color legend based on a numeric attribute (in this case the area of polygons)

In [ ]:
v = inter.VectorLayer("nuts1").opacity(255)
v.legendSet('line','stroke','#010000')
v.legendSet('line','stroke-width','1.0')
colors = ["Orange", "Yellow", "#008800", "#00ff55"]
v.colorCustom(colors)
#v.colorScheme("YlGnBu_soft")
v.legendGraduated("Shape_Area","natural",4)
#v.graduated("Shape_Area","pretty",15)
#v.graduated("Shape_Area","stddev",10)
#v.categories("ICC")
map.clear()  
tlayer = map.addLayer(v.toLayer())
#v.printXML()
In [ ]:
v.printColorSchemes()
In [ ]: