summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/StyleMap.html
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-08-12 21:56:44 +0200
committerChris Schlaeger <chris@linux.com>2014-08-12 21:56:44 +0200
commitea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch)
treeaf67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/tests/StyleMap.html
parent59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff)
downloadpostrunner-0.0.4.zip
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/tests/StyleMap.html')
-rw-r--r--misc/openlayers/tests/StyleMap.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/misc/openlayers/tests/StyleMap.html b/misc/openlayers/tests/StyleMap.html
new file mode 100644
index 0000000..6c633c3
--- /dev/null
+++ b/misc/openlayers/tests/StyleMap.html
@@ -0,0 +1,44 @@
+<html>
+<head>
+ <script src="OLLoader.js"></script>
+ <script type="text/javascript">
+
+ function test_StyleMap_constructor(t) {
+ t.plan(6);
+
+ var options = {'foo': 'bar'};
+ var styleMap = new OpenLayers.StyleMap(null, options);
+ t.ok(styleMap instanceof OpenLayers.StyleMap,
+ "new OpenLayers.StyleMap returns object" );
+ t.eq(styleMap.foo, "bar", "constructor sets options correctly");
+
+ var style = new OpenLayers.Style();
+ var styleMap = new OpenLayers.StyleMap(style);
+ t.eq(styleMap.styles["default"].defaultStyle.strokeColor, style.defaultStyle.strokeColor, "default style set correctly from style object");
+
+ var style = {strokeColor: "blue"};
+ var styleMap = new OpenLayers.StyleMap(style);
+ t.eq(styleMap.styles["default"].defaultStyle.strokeColor, "blue", "default style set correctly from style hash");
+
+ var style = {
+ "default": new OpenLayers.Style({strokeColor: "yellow"}),
+ "select": {strokeColor: "blue"}};
+ var styleMap = new OpenLayers.StyleMap(style);
+ t.eq(styleMap.styles["default"].defaultStyle.strokeColor, "yellow", "default style set correctly from a mixed hash of renderIntents");
+ t.eq(styleMap.styles["select"].defaultStyle.strokeColor, "blue", "select style set correctly from a mixed hash of renderIntents");
+ }
+
+ function test_StyleMap_destroy(t) {
+ t.plan(2);
+ var styleMap = new OpenLayers.StyleMap();
+ t.ok(styleMap.styles["default"], "Got a default style after initialisation");
+ styleMap.destroy();
+ t.ok(!styleMap.styles, "StyleMap styles successfully destroyed");
+ }
+
+ </script>
+</head>
+<body>
+ <div id="map" style="width:500px;height:500px"></div>
+</body>
+</html>