sorry if I'm asking stupid questions but I really spent days trying to figure out how to add functionality to my map so that when user clicks on some map object he gets the attribute table on the side with the attribute data of that object. Is it even possible? I don't speak about popups, I speak about actual table. This is how my map looks now:


I would like that space on the east side of monitor populate with that attribute table when users click. I'm not saying that's the best solution but that's how I imagined that. But I'm open for suggestions.

As you can see I use geoext, openlayers and extjs and honestly, I don't know lot about php or some other frameworks so I would be happy if the solution could be solved using geoext or smilair. I was looking around but nothing what I found is what I'm actually looking for.

One more time, sorry if my question is unprofessional or something but I'm really kind of desperate :)


You could use the FeatureGrid : http://api.geoext.org/1.1/examples/feature-grid.html

  • Yes, I tried with that, but every layer on my map has different attribute fields. And if I create feature grid then I first need to define attribute fields that I want to show in that grid panel. Or I got it wrong? Because if it's so, then I should create more feature grids panels, for every layer one, and that would be too much panels and informations on my map. – user14026 Mar 16 '13 at 10:54
  • You only need to create a FeatureStore for each layer, and change the source of the DataGrid according to the layer clicked. – Laurent Jégou Mar 16 '13 at 14:46
  • Ok, that seems like good solution. Now I just need to make it work like that. Thank you Laurent. – user14026 Mar 16 '13 at 15:20

You can try this code, this will display a pop-up containing attribute information of layers on that particular point.

controls.push(new OpenLayers.Control.WMSGetFeatureInfo({
            autoActivate: true,
            infoFormat: "application/vnd.ogc.gml",
            maxFeatures: 10,
            eventListeners: {
                "getfeatureinfo": function(e) {
                    var items = [];
                    Ext.each(e.features, function(feature) {
                            xtype: "propertygrid",
                            title: feature.fid,
                            source: feature.attributes,
                            editable: false
                    new GeoExt.Popup({
                        title: "Feature Info",
                        width: 300,
                        height: 500,
                        layout: "accordion",
                        map: app.mapPanel,
                        location: e.xy,
                        items: items

Ref: http://workshops.boundlessgeo.com/geoext/stores/getfeatureinfo.html

Your Answer

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