diff --git a/examples/label-scale.html b/examples/label-scale.html new file mode 100644 index 0000000000..d6d32ed764 --- /dev/null +++ b/examples/label-scale.html @@ -0,0 +1,34 @@ + + + + + + + OpenLayers Scale Dependent Labels + + + + + +

Scale Dependent Labels Example

+
+ label, scale, stylemap +
+

+ Demonstrates how to use a StyleMap for displaying scale dependent labels. +

+
+
+

+ This example uses rule based styling to change the how features are + labeled at different scales. An OpenLayers.Rule object + can have minScaleDenominator and + maxScaleDenominator properties to control when the + provided symbolizer should be used. +

+ View the source to see how this is done. +

+
+ + + diff --git a/examples/label-scale.js b/examples/label-scale.js new file mode 100644 index 0000000000..a46fe4b71c --- /dev/null +++ b/examples/label-scale.js @@ -0,0 +1,72 @@ +// Create 50 random features, and give them a "type" attribute that +// will be used for the label text. +var features = new Array(50); +for (var i=0; i