Adding OpenLayers.Strategy.Fixed: A simple strategy that requests features once and never requests new data. r=elemoine, (Closes #1664)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7707 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2008-08-05 11:55:24 +00:00
parent 4be8c169d4
commit 39201a0427
4 changed files with 99 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<html>
<head>
<script src="../../lib/OpenLayers.js"></script>
<script type="text/javascript">
function test_activate(t) {
t.plan(1);
var featureList = ['foo', 'bar'];
var layer = new OpenLayers.Layer.Vector("Vector Layer", {
strategies: [new OpenLayers.Strategy.Fixed()],
// a fake protocol
protocol: {
read: function(options) {
options.callback.call(options.scope, {features: featureList});
}
},
addFeatures: function(features) {
t.eq(features, featureList, "Features added to the layer");
}
});
var map = new OpenLayers.Map('map');
map.addLayer(layer);
}
</script>
</head>
<body>
<div id="map"/>
</body>
</html>
+1
View File
@@ -121,6 +121,7 @@
<li>Request/XMLHttpRequest.html</li>
<li>Rule.html</li>
<li>Strategy.html</li>
<li>Strategy/Fixed.html</li>
<li>Style.html</li>
<li>StyleMap.html</li>
<li>Tile.html</li>