~flavour/sahana-eden/trunk

« back to all changes in this revision

Viewing changes to static/scripts/gis/openlayers/lib/OpenLayers/Handler/Path.js

  • Committer: Fran Boon
  • Date: 2012-01-21 16:10:49 UTC
  • Revision ID: fran@aidiq.com-20120121161049-u2ytuiymn1t312c6
JS upgrade: jQuery, jQueryUI, OpenLayers, Ext, GeoExt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for 
 
1
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for 
2
2
 * full list of contributors). Published under the Clear BSD license.  
3
3
 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
4
4
 * full text of the license. */
30
30
     * APIProperty: maxVertices
31
31
     * {Number} The maximum number of vertices which can be drawn by this
32
32
     * handler. When the number of vertices reaches maxVertices, the
33
 
     * geometry is automatically finalized. This property doesn't
34
 
     * apply if freehand is set. Default is null.
 
33
     * geometry is automatically finalized. Default is null.
35
34
     */
36
35
    maxVertices: null,
37
36
 
446
445
            if(this.persist) {
447
446
                this.destroyPersistedFeature();
448
447
            }
449
 
            this.addPoint(evt.xy);
 
448
            if(this.maxVertices && this.line &&
 
449
                    this.line.geometry.components.length === this.maxVertices) {
 
450
                this.removePoint()
 
451
                this.finalize();
 
452
            } else {
 
453
                this.addPoint(evt.xy);
 
454
            }
450
455
            return false;
451
456
        }
452
457
        if (!this.touch && (!this.mouseDown || this.stoppedDown)) {