[Commits] r637 - sandbox/docsrc/tutorials
commits at geoext.org
commits at geoext.org
Thu May 7 22:51:33 CEST 2009
Author: tcoulter
Date: 2009-05-07 22:51:33 +0200 (Thu, 07 May 2009)
New Revision: 637
Modified:
sandbox/docsrc/tutorials/openlayers-primer.rst
Log:
First draft of Layers heading on the OL Primer.
Modified: sandbox/docsrc/tutorials/openlayers-primer.rst
===================================================================
--- sandbox/docsrc/tutorials/openlayers-primer.rst 2009-05-07 20:34:36 UTC (rev 636)
+++ sandbox/docsrc/tutorials/openlayers-primer.rst 2009-05-07 20:51:33 UTC (rev 637)
@@ -2,15 +2,102 @@
Primer: OpenLayers
====================
- Essential OpenLayers for working with GeoExt
+The OpenLayers mapping library is the key component of GeoExt, performing the core map-related
+functions of every GeoExt-based application. To get up to speed with GeoExt, let's discover
+some OpenLayers basics.
-
Layers
======
-all about layers
+As its name suggests, OpenLayers manages a list of layers that together form a web-based
+mapping client. Each layer represents a different piece of data: For instance, one layer
+might be responsible for displaying the boundary of a country, another layer responsible
+for that country's roads.
+OpenLayers contains many types of layers (you can see them all at the `OpenLayers website <http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer>`_). For this primer, we'll
+focus on two different layer types: WMS and WFS.
+WMS
+~~~
+
+This is the canonical layer type found in almost all GeoExt applications, where one or more images are used to
+display map-related information to the user. This type is named 'WMS' because it implements the
+`Web Map Service <http://www.opengeospatial.org/standards/wms>`_ standard set by the
+`Open Geospatial Consortium. <http://www.opengeospatial.org/>`_
+
+If you followed the :doc:`quickstart` guide in GeoExt under the heading 'Using GeoExt', you will have already encountered a MapPanel and created
+your very own WMS layer. Let's dissect what you did.
+
+new OpenLayers.Layer.WMS()
+--------------------------
+
+After creating an OpenLayers Map (but before creating a GeoExt MapPanel!), you encountered the following code:
+
+ .. code-block::
+ html
+
+ var layer = new OpenLayers.Layer.WMS(
+ "Blue Marble",
+ "http://sigma.openplans.org/geoserver/wms?",
+ {layers: "bluemarble"}
+ );
+ map.addLayer(layer);
+
+This tells OpenLayers that you'd like to create a new WMS layer referenced by the 'layer' variable, and that you'd like to add that layer
+to the map. In this case, we're adding the `Blue Marble data set provided by NASA <http://earthobservatory.nasa.gov/Features/BlueMarble/>`_
+
+The first parameter ("Blue Marble") represents the name of the layer. This can be anything, and is only used to reference the layer on screen.
+
+The second parameter represents the location of the WMS server tasked with providing the images. We're using a Geoserver instance located at
+sigma.openplans.org.
+
+The third parameter lets you override the parameters of every request passed to the WMS server. Since many servers host different
+data sets, we need to specify which set we'd like: We do this by creating a new object and setting the 'layers' key to the identifier
+of our Blue Marble data set.
+
+Note that 'layers' isn't the only WMS parameter we can override. You can find out more in the
+`OpenLayers Class Documentation <http://dev.openlayers.org/apidocs/>`_, by selecting 'Layer' and then 'WMS' in the navigation.
+
+And that's it! Now let's move onto WFS.
+
+
+WFS
+~~~
+
+WFS, like WMS, implements a standard set by the Open Geospatial Consortium, this time the
+`Web Feature Service <http://www.opengeospatial.org/standards/wfs>`_. Unlike WMS, however, the WFS layer is used to show
+points, lines and polygons ("geometries"; more broadly, "features") instead of displaying images. In many cases, this layer is
+used to perform client-side rendering instead of having features rendered by the server.
+
+new OpenLayers.Layer.WFS()
+--------------------------
+
+Creating a WFS layer is very similar to creating a WMS layer.
+
+ .. code-block::
+ html
+
+ var layer = new OpenLayers.Layer.WFS(
+ "United States",
+ "http://sigma.openplans.org/geoserver/wfs",
+ { typename: 'topp:states' }
+ );
+ map.addLayer(layer);
+
+Like the WMS layer, the paramaters contain a layer name ("United States"), the url of the data provider and options for the WFS request.
+In this case, we're requesting the 'topp:states' layer so it can be rendered in the browser by OpenLayers.
+
+This layers extends the `Vector Layer <http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer/Vector.js>`_.
+
+Other Layers
+------------
+
+WMS and WFS are not the only layers out there: There are plenty more available.
+`Browse the OpenLayers source code <http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer>`_ for more information.
+
+
+
+
Controls
========
More information about the Commits
mailing list