/* Parse HTML page created by CGI script and */
/* insert POIs in layer depending on the section */
OpenLayers_FreeX = OpenLayers.Class(
OpenLayers.Format, {
read: function(obj) {
if (obj) {
if (typeof obj == "string")
return parser(withoutTransformation, obj, "#FF00EE");
else
return null;
}
}
});
/* Call the CGI script to determine the */
/* individual POIs. The POIs are created depending on * /
/* the map section (OpenLayers.Strategy.BBOX) */
function map_layer_http_strategy(map, layer_name) {
// Define the strategy
var strategy =
[new OpenLayers.Strategy.BBOX({ratio: 1.0})];
// Parser definition
var format = new OpenLayers_FreeX();
// Define the communication channel
var protocol = new OpenLayers.Protocol.HTTP({
url: "/cgi-bin/FreeX/datbase.pl",
params: {country: "DE", magazine: "FreeX"},
srsInBBOX: true,
readWithPOST: true,
readWithGET: false,
headers: {"Content-Type": "text/plain"},
format: format
});
var layer = new OpenLayers.Layer.Vector(layer_name, {
projection: map.displayProjection,
renderers: map.renderer,
displayInLayerSwitcher: true,
wrapDateLine: false,
displayOutsideMaxExtend: true,
isBaseLayer: false,
styleMap: new OpenLayers.StyleMap(style),
strategies: strategy,
protocol: protocol
});
return layer;
}