Files
openlayers/tests/Feature/test_Vector.html

34 lines
910 B
HTML

<html>
<head>
<script src="../../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var map;
var feature;
function test_Feature_Vector_constructor(t) {
t.plan(3);
var geometry = new OpenLayers.Geometry();
geometry.id = Math.random();
var style = {foo: "bar"};
var attributes = {bar: "foo"};
feature = new OpenLayers.Feature.Vector(geometry, attributes, style);
t.ok(feature instanceof OpenLayers.Feature.Vector,
"new OpenLayers.Feature.Vector returns Feature.Vector object" );
t.eq(feature.attributes, attributes,
"attributes property set properly" );
t.eq(feature.geometry.id, geometry.id,
"geometry.property set properly" );
}
// -->
</script>
</head>
<body>
<div id="map" style="width: 500px; height: 300px;"></div>
</body>
</html>