geops/ole — pull request #22 by justb4 (2013-07-21 15:25:38+00:00)
Title: Allow UploadFeature Control to be used standalone

The Editor supports uploading new features into the drawing. There was a requirement to upload a vector file into an existing Vector Layer without the Editor. Just an upload button. Some small changes were required to realize this, mainly not using the Dialog Control from the Editor.

See an example here:
http://lib.heron-mc.org/heron/latest/examples/uploadfeatures/

At the same time two other issues appeared, that are also addressed in this pull:

- an option (checkbox) to allow all features to be replaced in or added to the Edit/Upload Layer
- issues with reprojection when uploading/downloading Formats with fixed projection like KML and GPX

The latter can now be realized using a config option per formatter, called "fileProjection". This may overrule the default file projection which is used for projection-less formats like WKT.

Such a config can look like:

{
url: Heron.globals.serviceUrl,
formats: [
{name: 'Well-Known-Text (WKT)', fileExt: '.wkt', mimeType: 'text/plain', formatter: 'OpenLayers.Format.WKT'},
{name: 'Geographic Markup Language - v2 (GML2)', fileExt: '.gml', mimeType: 'text/xml', formatter: 'OpenLayers.Format.GML'},
{name: 'GeoJSON', fileExt: '.json', mimeType: 'text/plain', formatter: 'OpenLayers.Format.GeoJSON'},
{name: 'GPS Exchange Format (GPX)', fileExt: '.gpx', mimeType: 'text/xml', formatter: 'OpenLayers.Format.GPX', fileProjection: new OpenLayers.Projection('EPSG:4326')},
{name: 'Keyhole Markup Language (KML)', fileExt: '.kml', mimeType: 'text/xml', formatter: 'OpenLayers.Format.KML', fileProjection: new OpenLayers.Projection('EPSG:4326')}
],
// For custom projections use Proj4.js
fileProjection: new OpenLayers.Projection('EPSG:28992')
}

An example is here:
http://lib.heron-mc.org/heron/latest/examples/editorbasics/
with the config file:
http://lib.heron-mc.org/heron/latest/examples/editorbasics/Config.js
No change was required to the server-side script. (which is still on my todo to provide more info to OLE).

I hope this pull can be merged easily, I had first fetched/synced with master.