As part of the MapServer polygons (district boundaries) are shown on the OpenLayers map. The script is in JavaScript. The polygons contain attributes. Currently, a second window opens with the corresponding attributes when a polygon is selected. What function must be used for the attributes to appear in the same window (in a selected area)?

This is my current query.

         var abfrage = new OpenLayers.Control.GetFeature({

               protocol: OpenLayers.Protocol.WFS({
                   url: GeoDataURL,
                   featureType: "VZKO",
                    featurePrefix: "ms",
                    version: "1.0.0",
                    srsName: "EPSG:31467",
                    geometryName: "msGeometry",

                   filterType: OpenLayers.Filter.Spatial.BBOX
               box: true,
               multipleKey: "shiftKey"

           abfrage.events.register("featureselected", this, function(e) {
               //alert(" in fselected");
               var feats = e.feature;

                /*var Msg = "<hr>";
                var NL  = "<br>";

                for(var key in feats.attributes)
                     Msg += key + ":" + feats.attributes[key] + NL;
                Msg += "geometry:" + feats.geometry + NL;
                document.getElementById('Auswertung').innerHTML += Msg;*/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.