Bienvenue sur PostGIS.fr

Bienvenue sur PostGIS.fr , le site de la communauté des utilisateurs francophones de PostGIS.

PostGIS ajoute le support d'objets géographique à la base de données PostgreSQL. En effet, PostGIS "spatialise" le serverur PostgreSQL, ce qui permet de l'utiliser comme une base de données SIG.

Maintenu à jour, en fonction de nos disponibilités et des diverses sorties des outils que nous testons, nous vous proposons l'ensemble de nos travaux publiés en langue française.

source: trunk/workshop-routing-foss4g/web/DrawPoints.js @ 76

Revision 76, 1.0 KB checked in by djay, 12 years ago (diff)

Ajout du répertoire web

  • Property svn:executable set to *
Line 
1DrawPoints = OpenLayers.Class(OpenLayers.Control.DrawFeature, {
2
3    // this control is active by default
4    autoActivate: true,
5
6    initialize: function(layer, options) {
7        // only points can be drawn
8        var handler = OpenLayers.Handler.Point;
9        OpenLayers.Control.DrawFeature.prototype.initialize.apply(
10                                this, [layer, handler, options]
11                        );
12    },
13
14    drawFeature: function(geometry) {
15        OpenLayers.Control.DrawFeature.prototype.drawFeature.apply(
16                                this, arguments 
17                        );
18        if (this.layer.features.length == 1) {
19            // we just draw the startpoint
20            // note: if we want to apply a special style to the
21            //       start point we should do this here
22        } else if (this.layer.features.length == 2) {
23            // we just draw the finalpoint
24            // note: if we want to apply a special style to the
25            //       final point we should do this here
26
27            // we have all what we need; we can deactivate ourself.
28            this.deactivate();           
29        }
30    }
31});
Note: See TracBrowser for help on using the repository browser.