When you have a layer with several overlapping geometries on the map at a higher zoom level, you may find it useful to create a cluster layer. This type of layer is a map viewer option that allows you to group multiple contiguous geometries into a single point.
Follow these steps to build your Cluster map:
1) Download the Tree inventory Shapefile from the City of Guelph, and import it into your eVouala account;
http://data.open.guelph.ca/dataset/tree-inventory
2) Create a map with this Data Source, then click "Edit template" in the properties of the Data Source in the Layer tree;
3) Replace these two variables:
* @styleitem
* @classes
With this mapping script:
## Step 1 - Add Cluster configuration options
CLUSTER
MAXDISTANCE 22 # in pixels
REGION "ellipse" # can be rectangle or ellipse
END
## Step 2 - Configurate the Cluster display
CLASS
EXPRESSION ([Cluster_FeatureCount] > 1)
NAME 'More then 1'
STYLE
COLOR '#31a354'
SYMBOL 'circle'
OPACITY 75
OUTLINEWIDTH 0.5
OUTLINECOLOR '#eff3ff'
SIZE 20
END
LABEL
TEXT "[Cluster_FeatureCount]"
SIZE 8
COLOR '#FFFFFF'
OUTLINEWIDTH 2
FONT 'mu'
POSITION CC
TYPE truetype
END
END
## Step 3 - Configurate the points display ...
CLASS
EXPRESSION ([Cluster_FeatureCount] = 1)
NAME 'Single tree'
STYLE
COLOR '#31a354'
SYMBOL 'circle'
OUTLINEWIDTH 0.5
OUTLINECOLOR '#eff3ff'
SIZE 7
END
END
Et vouala!
1 Comments