GXP_FOSS4G2011

Download Report

Transcript GXP_FOSS4G2011

GXP
Webmapping made easy (we hope)
FOSS4G, Sept 14th 2011
Bart van den Eijnden, OpenGeo
Contents
- What is GXP?
- What is ReadyGXP?
- Architecture
- Layer sources
- Tools
- So where's the easy part?
- Further reading
What is GXP?
- Client-side only library written in javascript
- Built on top of OpenLayers, Ext, GeoExt
- Application framework for the OpenGeo Suite
- Uses the Ext plugin architecture extensively
Ext plugins
Any component can now be extended through the use of
plugins. A plugin is any class with an init method that
accepts a single parameter of type Ext.Component.
Plugins can be added into any Component via the
plugins config option. When a component is created, if
any plugins are available, the component will call the init
method on each plugin, passing a reference to itself.
Each plugin can then call methods or respond to events
on the Component as needed to provide its functionality.
What is GXP?
- Leverages GeoServer and its extensions
- Configuration should be JSON only (can be
persisted easily)
- Governed by OpenGeo, not by a PSC
- Participation outside of OpenGeo is very much
welcomed (pull requests)
- GPL license
Project statistics
Project start: June 2009
22k lines of code (OL: 138k, GeoExt: 29k)
8k lines of comments
Lots of growth in 2010 and 2011
Project statistics - GXP
Project statistics - OpenLayers
Project statistics - GeoExt
What is ReadyGXP?
- Utility to set up a development environment
- Build static app for production
- Simple back-end functionality (persistence,
template rendering)
Getting started is easy
curl -L
https://github.com/opengeo/readygxp/ra
w/master/readygxp.sh | sh -s myviewer
ant init
ant debug
Architecture
Viewer
LayerSource
Tool
Architecture
- Central object is gxp.Viewer
- All layer sources extend
gxp.plugins.LayerSource
- All tools extend gxp.plugins.Tool
- Tools can have actions and output
gxp.Viewer
- portalConfig (Ext layout configuration)
- tools
- sources
- map (projection, layers etc.)
Supported layer sources
GoogleSource
BingSource
OSMSource
MapBoxSource
MapQuestSource
WMSSource
WMSCSource
OLSource
WMSSource
- Handles the WMS DescribeLayer and WFS
DescribeFeatureType requests automatically,
so that the WMS is tied to the WFS
- WMSCSource makes use of the integration
between GeoServer and GeoWebCache
(TILED=TRUE parameter)
Tools
Add Layers
Zoom to extent
Get Feature Info
Measure
Google Earth
Google Geocoder
Google Streetview
LayerTree
Print
Styling
Query builder
Snapping
Feature editing
Feature grid
So where's the easy part?
{
ptype: "gxp_wmsgetfeatureinfo",
outputConfig: {
width: 400
}
}
So where's the easy part?
{
ptype: "gxp_legend",
outputTarget: "legendpanel"
}
So where's the easy part?
{
ptype: "gxp_googlegeocoder",
outputTarget: "geocoder",
outputConfig: {
emptyText: "Search for a
location ..."
}
}
Google layer
sources: {
google: {
ptype: "gxp_googlesource"
}
}
Google layer
map: {
layers: [{
source: "google",
name: "ROADMAP",
group: "background"
}]
}
Setting up editing
{
ptype: "gxp_featuremanager",
id: "states_manager",
paging: false,
layer: {
source: "local",
name: "usa:states"
}
}
Setting up editing
{
ptype: "gxp_featureeditor",
featureManager: "states_manager",
autoLoadFeatures: true
}
Setting up editing
Setting up snapping
{
ptype: "gxp_snappingagent",
id: "snapping-agent",
targets: [{
source: "local",
name: "usa:states"
}]
}
Setting up snapping
{
ptype: "gxp_featureeditor",
featureManager: "states_manager",
autoLoadFeatures: true,
snappingAgent: "snapping-agent"
}
Feature grid
Styling
Resources
https://github.com/opengeo/gxp
https://github.com/opengeo/readygxp
http://gxp.opengeo.org/master/doc/
http://gxp.opengeo.org/master/examples/
http://workshops.opengeo.org/gxp/
Screencast
Questions?
OpenGeo
1-877-OPENGEO
http://www.opengeo.org
[email protected]