На клиенте:
Код: Выделить всё
<html>
<head>
<title>Fuck my brain!</title>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://taskmgr/cgi-bin/mapserv.exe",
{
map: 'W:\\ABL\\Map\\nsk.map',
layers: 'districts'
},
{
maxExtent: new OpenLayers.Bounds(597408,6072104,652389,6123575),
maxResolution: "auto",
units: "m"
}
);
select = new OpenLayers.Layer.Vector(
"Selection",
{styleMap: new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])}
);
map.addLayers([wms, select]);
control = new OpenLayers.Control.GetFeature(
{
protocol: new OpenLayers.Protocol.WFS(
{
version: "1.1.0",
url: "http://taskmgr/cgi-bin/mapserv.exe",
featureType: "districts",
srsName: "EPSG:4326",
extractAttributes: false
}
),
box: true,
hover: false,
multipleKey: "shiftKey",
toggleKey: "ctrlKey"
});
control.events.register("featureselected", this, function(e) {
select.addFeatures([e.feature]);
});
control.events.register("featureunselected", this, function(e) {
select.removeFeatures([e.feature]);
});
map.addControl(control);
control.activate();
map.zoomToMaxExtent();
</script>
</body>
</html>
Код: Выделить всё
MAP
IMAGETYPE PNG
EXTENT 597408.85 6072223.67 652389.48 6123575.00
SIZE 800 800
SHAPEPATH "."
IMAGECOLOR 255 255 255
WEB
IMAGEPATH "/ms4w/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
METADATA
"wfs_title" "WFS Server"
"wfs_onlineresource" "http://taskmgr/cgi-bin/mapserv.exe?"
"wfs_srs" "EPSG:4326"
"gml_include_items" "all"
END
END
PROJECTION
"init=epsg:4326"
END
LAYER
NAME districts
DATA Novosibirsk_districts.shp
STATUS ON
DUMP true
TYPE POLYGON
CLASS
STYLE
COLOR 239 227 173
OUTLINECOLOR 100 100 100
END
END
END
END
Где же я туплю?