| | 1 | <html> |
|---|
| | 2 | <head> |
|---|
| | 3 | <script src="../../lib/OpenLayers.js"></script> |
|---|
| | 4 | <script type="text/javascript"><!-- |
|---|
| | 5 | |
|---|
| | 6 | var poly_content = '{"type": "FeatureCollection", "members": [{"geometry": {"type": "Polygon", "coordinates": [[[-131.484375, -5.9765625], [-112.5, -58.0078125], [-32.34375, -50.2734375], [-114.609375, 52.3828125], [-167.34375, -35.5078125], [-146.953125, -57.3046875], [-139.921875, -34.1015625], [-131.484375, -5.9765625]]]}, "type": "Feature", "id": 562, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}]}'; |
|---|
| | 7 | var point_feature = '{"geometry": {"type": "Point", "coordinates": [94.21875, 72.94921875]}, "type": "Feature", "id": 573, "properties": {"strokeColor": "blue", "title": "Feature 5", "author": "Your Name Here"}}' |
|---|
| | 8 | var line_feature = '{"type": "FeatureCollection", "members": [{"geometry": {"type": "LineString", "coordinates": [[-27.0703125, 59.4140625], [-77.6953125, 20.7421875], [30.5859375, -36.2109375], [67.1484375, 34.8046875]]}, "type": "Feature", "id": 559, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}]}'; |
|---|
| | 9 | var multiple_features = '{"type": "FeatureCollection", "members": [{"geometry": {"type": "Point", "coordinates": [-91.0546875, 43.9453125]}, "type": "Feature", "id": 577, "properties": {"strokeColor": "red", "title": "Feature 2", "image": "foo.gif", "author": "Your Name Here"}}, {"geometry": {"type": "LineString", "coordinates": [[91.40625, -1.40625], [116.015625, -42.890625], [153.28125, -28.125], [108.984375, 11.25], [75.234375, 8.4375], [76.640625, 9.140625], [67.5, -36.5625], [67.5, -35.859375]]}, "type": "Feature", "id": 576, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [139.5703125, 57.48046875]}, "type": "Feature", "id": 575, "properties": {"strokeColor": "blue", "title": "Feature 7", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [107.2265625, 82.44140625]}, "type": "Feature", "id": 574, "properties": {"strokeColor": "blue", "title": "Feature 6", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [94.21875, 72.94921875]}, "type": "Feature", "id": 573, "properties": {"strokeColor": "blue", "title": "Feature 5", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [116.3671875, 61.69921875]}, "type": "Feature", "id": 572, "properties": {"strokeColor": "blue", "title": "Feature 4", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [145.8984375, 73.65234375]}, "type": "Feature", "id": 571, "properties": {"strokeColor": "blue", "title": "Feature 3", "author": "Your Name Here"}}, {"geometry": {"type": "Polygon", "coordinates": [[[32.34375, 52.20703125], [87.1875, 70.13671875], [122.6953125, 37.44140625], [75.234375, 42.36328125], [40.078125, 42.36328125], [28.828125, 48.33984375], [18.6328125, 56.77734375], [23.203125, 65.56640625], [32.34375, 52.20703125]]]}, "type": "Feature", "id": 570, "properties": {"strokeColor": "blue", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [62.578125, -53.4375]}, "type": "Feature", "id": 569, "properties": {"strokeColor": "red", "title": "Feature 3", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [121.640625, 16.875]}, "type": "Feature", "id": 568, "properties": {"strokeColor": "red", "title": "Feature 6", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [135.703125, 8.4375]}, "type": "Feature", "id": 567, "properties": {"strokeColor": "red", "title": "Feature 4", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [137.109375, 48.515625]}, "type": "Feature", "id": 566, "properties": {"strokeColor": "red", "title": "Feature 274", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 565, "properties": {}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 564, "properties": {}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 563, "properties": {}}, {"geometry": {"type": "Polygon", "coordinates": [[[-131.484375, -5.9765625], [-112.5, -58.0078125], [-32.34375, -50.2734375], [-114.609375, 52.3828125], [-167.34375, -35.5078125], [-146.953125, -57.3046875], [-139.921875, -34.1015625], [-131.484375, -5.9765625]]]}, "type": "Feature", "id": 562, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [48.8671875, -15.8203125]}, "type": "Feature", "id": 560, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "LineString", "coordinates": [[-27.0703125, 59.4140625], [-77.6953125, 20.7421875], [30.5859375, -36.2109375], [67.1484375, 34.8046875]]}, "type": "Feature", "id": 559, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [12.65625, 16.5234375]}, "type": "Feature", "id": 558, "properties": {"styleUrl": "#allstyle", "title": "Feature 1", "strokeColor": "red", "author": "Your Name Here"}}]}'; |
|---|
| | 10 | var parser = new OpenLayers.Format.GeoJSON(); |
|---|
| | 11 | |
|---|
| | 12 | |
|---|
| | 13 | function test_Format_GeoJSON_constructor(t) { |
|---|
| | 14 | t.plan(4); |
|---|
| | 15 | |
|---|
| | 16 | var options = {'foo': 'bar'}; |
|---|
| | 17 | var format = new OpenLayers.Format.GeoJSON(options); |
|---|
| | 18 | t.ok(format instanceof OpenLayers.Format.GeoJSON, |
|---|
| | 19 | "new OpenLayers.Format.GeoJSON returns object" ); |
|---|
| | 20 | t.eq(format.foo, "bar", "constructor sets options correctly"); |
|---|
| | 21 | t.eq(typeof format.read, "function", "format has a read function"); |
|---|
| | 22 | t.eq(typeof format.write, "function", "format has a write function"); |
|---|
| | 23 | } |
|---|
| | 24 | |
|---|
| | 25 | function test_Format_GeoJSON_valid_type(t) { |
|---|
| | 26 | t.plan(13); |
|---|
| | 27 | OpenLayers.Console.error = function(error) { window.global_error = error; } |
|---|
| | 28 | var types = ["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box"]; |
|---|
| | 29 | for (var i = 0; i < types.length; i++) { |
|---|
| | 30 | t.ok(parser.isValidType({'type':types[i]}, "Geometry"), "Geometry with type " + types[i] + " is valid"); |
|---|
| | 31 | } |
|---|
| | 32 | t.ok(!parser.isValidType({'type':"foo"}, "Geometry"), "Geometry with type foo is not valid"); |
|---|
| | 33 | t.eq(global_error, "Unsupported geometry type: foo", "error message set correctly for 'foo' geom."); |
|---|
| | 34 | t.ok(parser.isValidType({}, "FeatureCollection"), "Feature collection type is always valid"); |
|---|
| | 35 | t.ok(parser.isValidType({'type':"GeometryCollection"}, "GeometryCollection"), "Geometry Collection type is valid"); |
|---|
| | 36 | t.ok(!parser.isValidType({'type':"GeometryCollection2"}, "GeometryCollection"), "Geometry Collection 2 type is invalid"); |
|---|
| | 37 | t.eq(global_error, "Cannot convert types from GeometryCollection2 to GeometryCollection", "error message set correctly for bad geometrycollection type"); |
|---|
| | 38 | } |
|---|
| | 39 | |
|---|
| | 40 | function test_Format_GeoJSON_point(t) { |
|---|
| | 41 | t.plan(3); |
|---|
| | 42 | data = parser.read(point_feature); |
|---|
| | 43 | t.eq(data[0].fid, 573, "Fid is correct on point feature"); |
|---|
| | 44 | t.eq(data[0].geometry.x, 94.21875, 'Reading point feature gives correct x'); |
|---|
| | 45 | data = parser.read(point_feature, "Feature"); |
|---|
| | 46 | t.eq(data.fid, 573, 'Reading point feature with type gives feature instead of array of features '); |
|---|
| | 47 | } |
|---|
| | 48 | function test_Format_GeoJSON_line(t) { |
|---|
| | 49 | t.plan(5); |
|---|
| | 50 | data = parser.read(line_feature); |
|---|
| | 51 | t.eq(data[0].fid, 559, "Fid is correct on line feature"); |
|---|
| | 52 | t.eq(data[0].geometry.components.length, 4, 'Reading line feature gives correct length'); |
|---|
| | 53 | t.eq(data[0].geometry.CLASS_NAME, 'OpenLayers.Geometry.LineString', 'Reading line feature gives correct class'); |
|---|
| | 54 | t.eq(data[0].geometry.components[0].x, -27.0703125, 'Reading line feature gives correct x'); |
|---|
| | 55 | t.eq(data[0].geometry.components[0].y, 59.4140625, 'Reading line feature gives correct y'); |
|---|
| | 56 | } |
|---|
| | 57 | function test_Format_GeoJSON_poly(t) { |
|---|
| | 58 | t.plan(2); |
|---|
| | 59 | data = parser.read(poly_content); |
|---|
| | 60 | t.eq(data[0].fid, 562, "poly id is correct") |
|---|
| | 61 | t.eq(data[0].geometry.components[0].components.length, 8, |
|---|
| | 62 | 'Reading polygon first ring on feature from featurecollection gives correct length'); |
|---|
| | 63 | } |
|---|
| | 64 | |
|---|
| | 65 | function test_Format_GeoJSON_multipoint(t) { |
|---|
| | 66 | t.plan(5); |
|---|
| | 67 | var multipoint = { |
|---|
| | 68 | "type": "MultiPoint", |
|---|
| | 69 | "coordinates": [ |
|---|
| | 70 | [100.0, 0.0], [101.0, 1.0] |
|---|
| | 71 | ] |
|---|
| | 72 | } |
|---|
| | 73 | data = parser.read(multipoint, "Geometry"); |
|---|
| | 74 | t.eq(data.components.length, 2, |
|---|
| | 75 | "Right number of components"); |
|---|
| | 76 | t.eq(data.components[0].CLASS_NAME, "OpenLayers.Geometry.Point", "First component is point"); |
|---|
| | 77 | t.eq(data.components[1].CLASS_NAME, "OpenLayers.Geometry.Point", "Second component is point"); |
|---|
| | 78 | t.eq(data.components[1].x, 101, "x of second component is right"); |
|---|
| | 79 | t.eq(data.components[1].y, 1, "y of second component is right"); |
|---|
| | 80 | } |
|---|
| | 81 | |
|---|
| | 82 | |
|---|
| | 83 | function test_Format_GeoJSON_multiline(t) { |
|---|
| | 84 | t.plan(3); |
|---|
| | 85 | var multiline = { |
|---|
| | 86 | "type": "MultiLineString", |
|---|
| | 87 | "coordinates": [ |
|---|
| | 88 | [ [100.0, 0.0], [101.0, 1.0] ], |
|---|
| | 89 | [ [102.0, 2.0], [103.0, 3.0] ] |
|---|
| | 90 | ] |
|---|
| | 91 | } |
|---|
| | 92 | data = parser.read(multiline, "Geometry"); |
|---|
| | 93 | t.eq(data.CLASS_NAME, "OpenLayers.Geometry.MultiLineString", "Correct class retrieved") |
|---|
| | 94 | t.eq(data.components[0].components[0].CLASS_NAME, "OpenLayers.Geometry.Point", "correct type of components") |
|---|
| | 95 | t.eq(data.components[0].CLASS_NAME, "OpenLayers.Geometry.LineString", "correct type of components") |
|---|
| | 96 | } |
|---|
| | 97 | function test_Format_GeoJSON_multipol(t) { |
|---|
| | 98 | t.plan(2); |
|---|
| | 99 | var multipol = { |
|---|
| | 100 | "type": "MultiPolygon", |
|---|
| | 101 | "coordinates": [ |
|---|
| | 102 | [ |
|---|
| | 103 | [ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ] |
|---|
| | 104 | ], |
|---|
| | 105 | [ |
|---|
| | 106 | [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], |
|---|
| | 107 | [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] |
|---|
| | 108 | ] |
|---|
| | 109 | ] |
|---|
| | 110 | } |
|---|
| | 111 | OpenLayers.Console.error = function(error) { window.global_error = error; } |
|---|
| | 112 | data = parser.read(multipol, "Geometry"); |
|---|
| | 113 | t.eq(data.CLASS_NAME, "OpenLayers.Geometry.MultiPolygon", "Correct class retrieved") |
|---|
| | 114 | t.eq(data.components[1].components[0].components[0].CLASS_NAME, "OpenLayers.Geometry.Point", "correct type of components") |
|---|
| | 115 | } |
|---|
| | 116 | |
|---|
| | 117 | function test_Format_GeoJSON_box(t) { |
|---|
| | 118 | t.plan(6); |
|---|
| | 119 | var box = { |
|---|
| | 120 | "type": "Box", |
|---|
| | 121 | "coordinates": [[100.0, 0.0], [101.0, 1.0]] |
|---|
| | 122 | }; |
|---|
| | 123 | var poly = parser.read(box, "Geometry"); |
|---|
| | 124 | t.eq(poly.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Box creates polygon"); |
|---|
| | 125 | t.eq(poly.components[0].components[1].x, 101, "x of lower right is correct"); |
|---|
| | 126 | t.eq(poly.components[0].components[1].y, 0, "y of lower right is correct"); |
|---|
| | 127 | t.eq(poly.components[0].components[3].x, 100, "x of upper left is correct"); |
|---|
| | 128 | t.eq(poly.components[0].components[3].y, 1, "y of upper left is correct"); |
|---|
| | 129 | var box = parser.write(poly ); |
|---|
| | 130 | t.ok(box.search("Polygon") != -1 , "Serializes back to polygon"); |
|---|
| | 131 | } |
|---|
| | 132 | |
|---|
| | 133 | |
|---|
| | 134 | |
|---|
| | 135 | |
|---|
| | 136 | // This test is from the geom_collection example on geojson spec. |
|---|
| | 137 | function test_Format_GeoJSON_geom_collection(t) { |
|---|
| | 138 | t.plan(7); |
|---|
| | 139 | var geomcol = { |
|---|
| | 140 | "type": "GeometryCollection", |
|---|
| | 141 | "members": [ |
|---|
| | 142 | { |
|---|
| | 143 | "type": "Point", |
|---|
| | 144 | "coordinates": [100.0, 0.0] |
|---|
| | 145 | }, |
|---|
| | 146 | { |
|---|
| | 147 | "type": "LineString", |
|---|
| | 148 | "coordinates": [ |
|---|
| | 149 | [101.0, 0.0], [102.0, 1.0] |
|---|
| | 150 | ] |
|---|
| | 151 | } |
|---|
| | 152 | ] |
|---|
| | 153 | } |
|---|
| | 154 | data = parser.read(geomcol, "GeometryCollection"); |
|---|
| | 155 | t.eq(data[0].CLASS_NAME, |
|---|
| | 156 | "OpenLayers.Geometry.Point", "First geom in geom collection is point type"); |
|---|
| | 157 | t.eq(data[0].x, 100, "First geom in geom collection has correct x"); |
|---|
| | 158 | t.eq(data[0].y, 0, "First geom in geom collection has correct x"); |
|---|
| | 159 | |
|---|
| | 160 | t.eq(data[1].CLASS_NAME, |
|---|
| | 161 | "OpenLayers.Geometry.LineString", "Second geom in geom collection is point linestring"); |
|---|
| | 162 | t.eq(data[1].components.length, 2, "linestring is correct length"); |
|---|
| | 163 | t.eq(data[1].components[1].x, 102, "linestring is correct x end"); |
|---|
| | 164 | t.eq(data[1].components[1].y, 1, "linestring is correct y end"); |
|---|
| | 165 | |
|---|
| | 166 | } |
|---|
| | 167 | |
|---|
| | 168 | function test_Format_GeoJSON_multipleFeatures(t) { |
|---|
| | 169 | t.plan(2); |
|---|
| | 170 | var feats = parser.read(multiple_features); |
|---|
| | 171 | t.eq(feats.length, 19, "parsing a feature collection returns the correct number of features."); |
|---|
| | 172 | var types = {'Point':0, 'LineString':0, 'Polygon':0} |
|---|
| | 173 | for(var i = 0; i < feats.length; i++) { |
|---|
| | 174 | var type = feats[i].geometry.CLASS_NAME.replace("OpenLayers.Geometry.", ""); |
|---|
| | 175 | types[type]++; |
|---|
| | 176 | } |
|---|
| | 177 | t.eq(types, {'Point':15, 'Polygon': 2, 'LineString':2}, "Correct number of each type"); |
|---|
| | 178 | } |
|---|
| | 179 | |
|---|
| | 180 | function test_Format_GeoJSON_write(t) { |
|---|
| | 181 | t.plan(10); |
|---|
| | 182 | var line_object = {"type": "FeatureCollection", |
|---|
| | 183 | "members": [{"geometry": |
|---|
| | 184 | {"type": "LineString", |
|---|
| | 185 | "coordinates": [[-27.0703125, 59.4140625], |
|---|
| | 186 | [-77.6953125, 20.7421875], |
|---|
| | 187 | [30.5859375, -36.2109375], |
|---|
| | 188 | [67.1484375, 34.8046875]]}, |
|---|
| | 189 | "type": "Feature", |
|---|
| | 190 | "id": 559, |
|---|
| | 191 | "properties": |
|---|
| | 192 | { |
|---|
| | 193 | "strokeColor": "red", |
|---|
| | 194 | "title": "Feature 1", |
|---|
| | 195 | "author": "Your Name Here"}}]}; |
|---|
| | 196 | data = parser.read(line_object); |
|---|
| | 197 | out = parser.write(data); |
|---|
| | 198 | serialized = '{"type":"FeatureCollection","members":[{"type":"Feature","id":559,"properties":{"strokeColor":"red","title":"Feature 1","author":"Your Name Here"},"geometry":{"type":"LineString","coordinates":[[-27.0703125,59.4140625],[-77.6953125,20.7421875],[30.5859375,-36.2109375],[67.1484375,34.8046875]]}}]}'; |
|---|
| | 199 | t.eq(out, serialized, "input and output on line collections are the same"); |
|---|
| | 200 | |
|---|
| | 201 | var serialize_tests = [ |
|---|
| | 202 | [new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(1,2)), |
|---|
| | 203 | '{"type":"Feature","id":0,"properties":{},"geometry":{"type":"Point","coordinates":[1,2]}}'], |
|---|
| | 204 | [new OpenLayers.Geometry.Point(1,2), |
|---|
| | 205 | '{"type":"Point","coordinates":[1,2]}'], |
|---|
| | 206 | [new OpenLayers.Geometry.MultiPoint([new OpenLayers.Geometry.Point(1,2)]), |
|---|
| | 207 | '{"type":"MultiPoint","coordinates":[[1,2]]}'], |
|---|
| | 208 | [new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(1,2), new OpenLayers.Geometry.Point(3,4)]), |
|---|
| | 209 | '{"type":"LineString","coordinates":[[1,2],[3,4]]}'], |
|---|
| | 210 | [new OpenLayers.Geometry.Polygon([ |
|---|
| | 211 | new OpenLayers.Geometry.LinearRing([ |
|---|
| | 212 | new OpenLayers.Geometry.Point(1,2), |
|---|
| | 213 | new OpenLayers.Geometry.Point(3,4), |
|---|
| | 214 | new OpenLayers.Geometry.Point(5,6)])]), |
|---|
| | 215 | '{"type":"Polygon","coordinates":[[[1,2],[3,4],[5,6],[1,2]]]}'] |
|---|
| | 216 | ]; |
|---|
| | 217 | serialize_tests[0][0].fid = 0; |
|---|
| | 218 | multiline = new OpenLayers.Geometry.MultiLineString([serialize_tests[3][0], serialize_tests[3][0]]); |
|---|
| | 219 | serialize_tests.push([multiline, '{"type":"MultiLineString","coordinates":[[[1,2],[3,4]],[[1,2],[3,4]]]}']); |
|---|
| | 220 | multipolygon = new OpenLayers.Geometry.MultiPolygon([serialize_tests[4][0], serialize_tests[4][0]]); |
|---|
| | 221 | serialize_tests.push([multipolygon, '{"type":"MultiPolygon","coordinates":[[[[1,2],[3,4],[5,6],[1,2]]],[[[1,2],[3,4],[5,6],[1,2]]]]}']); |
|---|
| | 222 | serialize_tests.push([ [ serialize_tests[0][0] ], '{"type":"FeatureCollection","members":[{"type":"Feature","id":0,"properties":{},"geometry":{"type":"Point","coordinates":[1,2]}}]}' ]); |
|---|
| | 223 | serialize_tests.push([ [ serialize_tests[1][0], serialize_tests[2][0] ], '{"type":"GeometryCollection","members":[{"type":"Point","coordinates":[1,2]},{"type":"MultiPoint","coordinates":[[1,2]]}]}' ]); |
|---|
| | 224 | for (var i = 0; i < serialize_tests.length; i++) { |
|---|
| | 225 | var input = serialize_tests[i][0]; |
|---|
| | 226 | var output = serialize_tests[i][1]; |
|---|
| | 227 | test_out = parser.write(input); |
|---|
| | 228 | t.eq(test_out, output, "Serializing " + input.toString() + " saved correctly."); |
|---|
| | 229 | } |
|---|
| | 230 | } |
|---|
| | 231 | |
|---|
| | 232 | |
|---|
| | 233 | function test_Format_GeoJSON_read_object(t) { |
|---|
| | 234 | t.plan(1); |
|---|
| | 235 | var line_object = {"type": "FeatureCollection", |
|---|
| | 236 | "members": [{"geometry": |
|---|
| | 237 | {"type": "LineString", |
|---|
| | 238 | "coordinates": [[-27.0703125, 59.4140625], |
|---|
| | 239 | [-77.6953125, 20.7421875], |
|---|
| | 240 | [30.5859375, -36.2109375], |
|---|
| | 241 | [67.1484375, 34.8046875]]}, |
|---|
| | 242 | "type": "Feature", |
|---|
| | 243 | "id": 559, |
|---|
| | 244 | "properties": |
|---|
| | 245 | { |
|---|
| | 246 | "strokeColor": "red", |
|---|
| | 247 | "title": "Feature 1", |
|---|
| | 248 | "author": "Your Name Here"}}]}; |
|---|
| | 249 | data = parser.read(line_object); |
|---|
| | 250 | t.eq(data[0].fid, 559, "Can read data from an object correctly."); |
|---|
| | 251 | } |
|---|
| | 252 | |
|---|
| | 253 | function test_Format_GeoJSON_read_attributes(t) { |
|---|
| | 254 | t.plan(3); |
|---|
| | 255 | var parser = new OpenLayers.Format.GeoJSON(); |
|---|
| | 256 | data = parser.read(line_feature); |
|---|
| | 257 | t.eq(data[0].attributes['strokeColor'], 'red', 'read strokeColor attribute properly'); |
|---|
| | 258 | t.eq(data[0].attributes['title'], 'Feature 1', 'read title attribute properly'); |
|---|
| | 259 | t.eq(data[0].attributes['author'], 'Your Name Here', 'read author attribute properly'); |
|---|
| | 260 | } |
|---|
| | 261 | |
|---|
| | 262 | // --> |
|---|
| | 263 | </script> |
|---|
| | 264 | </head> |
|---|
| | 265 | <body> |
|---|
| | 266 | </body> |
|---|
| | 267 | </html> |