[OpenLayers-Dev] Vector Diffs
crschmidt at metacarta.com
Thu Mar 15 00:26:38 EDT 2007
Tonight, I went through
svn diff http://svn.openlayers.org/trunk/openlayers/lib/
http://svn.openlayers.org/sandbox/vector-2.4/lib/ and looked at every
Follows is a summary of changes to the existing OpenLayers code. The only
non-documentation/functional changes to existing files were:
Added registerPriority function, which puts a listener at the beginning of
* Added activate/deactivate methods which set active flag and return
true or false depending on whether the state has changed.
* Calculate a default displayClass:
this.displayClass = this.CLASS_NAME.replace("OpenLayers.",
* Added OpenLayers.Control.TYPE_BUTTON, TYPE_TOOL constants for
building toolbar controls.
* setMap will now call setMap on any handler property on the control.
default controls changed from using MouseDefaults to using Navigation
If given a 'postBody' parameter, the content-type is no longer set to
x-www-form-encoded. This allows us to post WFS data. x-www-form-encoded
data can still be passed using parameters and setting 'method' to 'post'.
Add an 'extend' method to Bounds().
OpenLayers/Layer/WFS.js -- still working on this one.
The rest of the changes are either:
* New files
* Only documentation changes.
In total, changes in existing files account for only ~50 lines of code.
The rest of the changes are described here.
OpenLayers/Control/EditingToolbar.js -- New file.
OpenLayers/Control/DrawFeature.js -- New file.
OpenLayers/Control/DragPan.js -- new file. Used by navigation control.
OpenLayers/Control/ZoomToMaxExtent.js -- new file. demo of 'button' functionality.
OpenLayers/Control/SelectFeature.js -- new file.
OpenLayers/Control/ZoomBox.js -- new file. used by Navigation control.
OpenLayers/Control/Panel.js -- new file. Used for building toolbars
OpenLayers/Control/MouseDefaults.js -- added deprecation warning.
OpenLayers/Control/MouseToolbar.js -- added deprecation warning.
Modified classNames to use new 'this.displayClass', so constants like
'olControlOverviewMapElement' can now be overridden by setting displayClass
as an option on the layer. No functional changes.
Refactored to use Handlers. (Since this has never been released, changing
the internals is not painful.)
OpenLayers/Control/Navigation.js -- replaces MouseDefaults.
OpenLayers/Control/NavToolbar.js -- replaces MouseToolbar.
New files to support vector drawing. Used by Layer.Vector and its
subclasses. Renderer/Elements is a subclass of SVG/VML, used to capture the
similiarities inherent in element-based renderers.
As part of evaluation of the MouseListener code, we realized that there is
a level of abstraction that was not really well defined in the code.
Essentially, there are a number of core events -- like drawing a box,
dragging the mouse, and drawing point/path/polygon features -- below the level
of the "Controls". In order to make developing controls more modular and
easier, we've migrated this functionality into a set of handlers which
encapsulates these methods. As described in a mailing list post, this has
made things like MouseDefaults a trivial control using these handlers.
OpenLayers/Format/GML.js -- full read/write
OpenLayers/Format/WFS.js -- subclass of GML, WFS-T writing
OpenLayers/Format/KML.js -- read only
OpenLayers/Format/GeoRSS.js -- write only
Formats define two methods: a 'read' and 'write'. read takes some data --
string, XML document, etc. -- and returns a list of features. KML and
GeoRSS are partial implementations as part of a proof of concept, and can
be finished via interested parties. Formats are new in the vector-2.4
Geometries store geographic information. Features have geometries. (You
can't draw a geometry: you draw a feature, which has a geometry and style.)
Subclass of Feature specifically for Vector rendering.
OpenLayers/Layer/Vector.js -- Simple base class. Allows for drawing of
OpenLayers/Layer/GML.js -- Load remote data, parse it based on the chosen
parser, and display it as vectors. (This means it is also Layer.KML,
by changing the format in use.)
More information about the Dev