diff --git a/examples/data/busstops.geojson b/examples/data/busstops.geojson new file mode 100644 index 000000000..214249f6c --- /dev/null +++ b/examples/data/busstops.geojson @@ -0,0 +1,88 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "id": "osm-busstops.fid-450a1ab3_149e7ccb0c9_30ad", + "geometry": { + "type": "Point", + "coordinates": [1218828.5056681812, + 6620850.261476886] + }, + "geometry_name": "geometry", + "properties": { + "id": 1130170, + "osm_id": 1688977159, + "name": "Salomonsborn", + "type": "bus_stop", + "ref": "" + } + }, + { + "type": "Feature", + "id": "osm-busstops.fid-450a1ab3_149e7da3233_e78", + "geometry": { + "type": "Point", + "coordinates": [599198.5191414315, + 5359744.431373389] + }, + "geometry_name": "geometry", + "properties": { + "id": 1130233, + "osm_id": 1689159158, + "name": "Barbini Loubon", + "type": "bus_stop", + "ref": "" + } + }, + { + "type": "Feature", + "id": "osm-busstops.fid-450a1ab3_149e7ccb0c9_30af", + "geometry": { + "type": "Point", + "coordinates": [954416.1508209753, + 6012682.402613947] + }, + "geometry_name": "geometry", + "properties": { + "id": 1130181, + "osm_id": 1689025037, + "name": "Opfikon, Schulstrasse", + "type": "bus_stop", + "ref": "" + } + }, + { + "type": "Feature", + "id": "osm-busstops.fid-450a1ab3_149e7ccb0c9_30b5", + "geometry": { + "type": "Point", + "coordinates": [1816615.967539551, + 5948768.54551049] + }, + "geometry_name": "geometry", + "properties": { + "id": 1130187, + "osm_id": 1689043500, + "name": "Unterlangzeil Nr.5", + "type": "bus_stop", + "ref": "" + } + }, + { + "type": "Feature", + "id": "osm-busstops.fid-450a1ab3_149e7da3233_-20e8", + "geometry": { + "type": "Point", + "coordinates": [-696436.2255883364, + 7037778.549495307] + }, + "geometry_name": "geometry", + "properties": { + "id": 1130192, + "osm_id": 1689050200, + "name": "Churchtown Rd. Upper/Jct. Beaumont Avenue", + "type": "bus_stop", + "ref": "1035" + } + }] +} \ No newline at end of file diff --git a/examples/grid/feature-grid-w-proxy.html b/examples/grid/feature-grid-w-proxy.html new file mode 100644 index 000000000..8c61c3073 --- /dev/null +++ b/examples/grid/feature-grid-w-proxy.html @@ -0,0 +1,47 @@ + + +
+This example shows an Ext grid loaded with features read from a + GeoJSON document + (../data/busstops.geojson) via a GeoExt.data.proxy.Protocol. + The GeoJSON is taken from this WFS +
+ +Because the layer and the store are bound to each other, the + features loaded into the store are automatically added to the layer. A + GeoExt feature selection model is also used so that selecting rows in + the grid selects features in the layer, and vice-versa.
+ + + + + + diff --git a/examples/grid/feature-grid-w-proxy.js b/examples/grid/feature-grid-w-proxy.js new file mode 100644 index 000000000..8628d8f65 --- /dev/null +++ b/examples/grid/feature-grid-w-proxy.js @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2008-2014 The Open Source Geospatial Foundation + * + * Published under the BSD license. + * See https://github.com/geoext/geoext2/blob/master/license.txt for the full + * text of the license. + */ + +/** api: example[feature-grid-w-proxy] + * Grid with Features via Proxy + * ------------------ + * Synchronize selection of features between a grid and a layer. + */ + +var mapPanel, store, gridPanel, mainPanel; + +Ext.require([ + 'GeoExt.panel.Map', + 'GeoExt.data.FeatureStore', + 'GeoExt.data.proxy.Protocol', + 'GeoExt.selection.FeatureModel', + 'Ext.grid.GridPanel', + 'Ext.layout.container.Border' +]); + +Ext.application({ + name: 'Feature Grid with Proxy - GeoExt2', + launch: function() { + // create map instance + var map = new OpenLayers.Map({projection: 'EPSG:900913'}); + var wmsLayer = new OpenLayers.Layer.WMS( + "OpenStreetMap WMS", + "http://ows.terrestris.de/osm-gray/service?", + {layers: 'OSM-WMS'}, + { + attribution: '© terrestris GmbH & Co. KG