ascii_qgis.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:ascii_qgis 作者: NathanW2 项目源码 文件源码
def assign_layer_colors():
    """
    Assign all the colors for each layer up front so we can use
    it though the application.
    """
    import itertools
    colors = itertools.cycle(range(11, curses.COLORS - 10))
    layercolormapping.clear()
    root = QgsProject.instance().layerTreeRoot()
    layers = [node.layer() for node in root.findLayers()]
    for layer in reversed(layers):
        if not layer.type() == QgsMapLayer.VectorLayer:
            continue
        layercolormapping[layer.id()] = colors.next()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号