def graduatedLayer(layer, safeLayerName, renderer, outputProjectFileName, labeltext, cluster, json, usedFields, legends, wfsLayers, markerType): catLegend = layer.name() + "<br />" catLegend += "<table>" for cnt, r in enumerate(renderer.ranges()): symbol = r.symbol() catLegend = iconLegend(symbol, r, outputProjectFileName, safeLayerName, catLegend, cnt) catLegend += "</table>" if layer.geometryType() == QGis.Point: (new_obj, wfsLayers) = pointLayer(layer, safeLayerName, labeltext, cluster, usedFields, json, wfsLayers, markerType, symbol) else: (new_obj, wfsLayers) = nonPointLayer(layer, safeLayerName, usedFields, json, wfsLayers) legends[safeLayerName] = catLegend return new_obj, legends, wfsLayers
def categorizedLayer(layer, renderer, safeLayerName, outputProjectFileName, usedFields, legends, labeltext, cluster, json, wfsLayers, markerType): catLegend = layer.name().replace("'", "\\'") + "<br />" catLegend += "<table>" categories = renderer.categories() for cnt, cat in enumerate(categories): symbol = cat.symbol() catLegend = iconLegend(symbol, cat, outputProjectFileName, safeLayerName, catLegend, cnt) catLegend += "</table>" if layer.geometryType() == QGis.Point: (new_obj, wfsLayers) = pointLayer(layer, safeLayerName, labeltext, cluster, usedFields, json, wfsLayers, markerType, symbol) else: (new_obj, wfsLayers) = nonPointLayer(layer, safeLayerName, usedFields, json, wfsLayers) legends[safeLayerName] = catLegend return new_obj, legends, wfsLayers
def ruleBasedLayer(layer, renderer, safeLayerName, outputProjectFileName, usedFields, legends, cluster, json, wfsLayers, markerType, useMultiStyle): catLegend = layer.name() + "<br />" catLegend += "<table>" root_rule = renderer.rootRule() rules = root_rule.children() for cnt, r in enumerate(rules): symbol = r.symbol() catLegend = iconLegend(symbol, r, outputProjectFileName, safeLayerName, catLegend, cnt) catLegend += "</table>" if layer.geometryType() == QGis.Point: (new_obj, wfsLayers, useMultiStyle) = pointLayer(layer, safeLayerName, cluster, usedFields, json, wfsLayers, markerType, symbol, useMultiStyle) else: (new_obj, wfsLayers, useMultiStyle) = nonPointLayer(layer, safeLayerName, usedFields, json, wfsLayers, symbol, useMultiStyle) legends[safeLayerName] = catLegend return new_obj, legends, wfsLayers, useMultiStyle