[Users] linked grid and map

Eric Lemoine eric.lemoine at camptocamp.com
Tue Dec 14 08:41:31 CET 2010


On Mon, Dec 13, 2010 at 9:24 PM, percy <percyd at pdx.edu> wrote:
> Hi,
>
> I'm using a featurestore to populate a grid and map [1], with the
> GeoExt.grid.FeatureSelectionModel linking the two so that when the user
> clicks on a polygon feature the grid hilights the corresponding row, and
> scolls to it.
>
> This works great!
>
> Is there a simple way to get the reverse functionality in the map so
> that when a row is clicked it hilights the map feature (it does that
> now, of course), and ZOOMS to it?

Hi

You can register a listener to the "rowselect" event for that:

new GeoExt.grid.FeatureSelectionModel({
    listeners: {
        "rowselect": function(sm, rowIdx, rec) {
            map.zoomToExtent(rec.getFeature().getBounds());
        }
    }
});


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list