Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am building a web application to facilitate the handling of approximately 2500+ historic maps. I think it would be too difficult for our users to search for specific maps in an ordinary layer tree.

Is there some way to implement a layersearch in a GeoExt/Geoserver stack?

I'd be grateful for any idea how to deal with that even if it's not an "out-of-the-box"-solution.

share|improve this question
    
I really don't think it is a good idea to load all 2500+ layers at one time. The user experience will be painfull at best. And Openlayers supports only upto 75 layers trac.osgeo.org/openlayers/wiki/… –  Devdatta Tengshe Feb 27 '13 at 16:31

2 Answers 2

What about providing the users with an intelligent search bar (that auto-suggests answers)? This can be easily populated with layer names by making an AJAX GET layer names request to GeoServer at page load. You could then include a few defaults and this 'intelligent' load list.

share|improve this answer
up vote 1 down vote accepted

Thanks for your ideas everyone. I came up with a neat solution myself and wanted to share it with you all. In order to manage that huge amount of layers I use an ExtJS Grid Panel which gets its entrys over a GetCapabilities Request from my GeoServer. In addition to this I use a custom plugin which embeds a pretty fast search (or better filter) functionality (tested with extjs 3). Here is my code:

{
                        xtype: 'grid',
                        title: "Verf&uumlgbare Karten",
                        ref: "capsGrid",
                        id: "capsGrid",
                        height: 150,
                        viewConfig: {forceFit: true},
                        selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
                        plugins : [new Ext.ux.grid.Search({
                                    iconCls:'icon-zoom'
                                    ,readonlyIndexes:['country']
                                    ,disableIndexes:['pctChange']
                                    ,minChars:1
                                    ,autoFocus:true
                                    ,mode:'local' // to filter on local; for remote add mode:'remote'
                                    ,width: '20'
                                })],
                        bbar: [{
                        text: "Hinzuf&uumlgen",
                        handler: function() {
                            Heron.layout.items[0].items[1].items[0].selModel.grid.getSelectionModel().each(function(record) {
                                var clone = record.clone();
                                clone.getLayer().mergeNewParams({
                                format: "image/png",
                                transparent: true
                                });
                                var map = Heron.App.getMapPanel();
                                map.layers.add(clone);
                                Heron.App.getMap().zoomToExtent(
                                OpenLayers.Bounds.fromArray(clone.get("llbbox"))
                                );
                            });
                        }
                        }],
                        store: new GeoExt.data.WMSCapabilitiesStore({
                            url: "http://localhost:8080/geoserver/wms?service=wms&version=1.1.1&request=GetCapabilities",
                            autoLoad: true
                            }),
                            columns: [
                                //{header: "Name", dataIndex: "name", sortable: true},
                                {header: "Titel", dataIndex: "title", sortable: true},
                                //{header: "Abstract", dataIndex: "abstract"}
                                ],
                        },

In the end it looks like this: enter image description here

Here are all the links you need:

The gridsearch plugin

Description how to use this plugin

OpenGeo Workshop that shows how to configure your Ext Grid

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.