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/OpenLayers/lib/OpenLayers/Control/Pan.js @ 76

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

Ajout du répertoire web

  • Property svn:executable set to *
Line 
1/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for
2 * full list of contributors). Published under the Clear BSD license. 
3 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
4 * full text of the license. */
5
6/**
7 * @requires OpenLayers/Control.js
8 */
9
10/**
11 * Class: OpenLayers.Control.Pan
12 * The Pan control is a single button to pan the map in one direction. For
13 * a more complete control see <OpenLayers.Control.PanPanel>.
14 *
15 * Inherits from:
16 *  - <OpenLayers.Control>
17 */
18OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
19
20    /**
21     * APIProperty: slideFactor
22     * {Integer} Number of pixels by which we'll pan the map in any direction
23     *     on clicking the arrow buttons, defaults to 50.
24     */
25    slideFactor: 50,
26
27    /**
28     * Property: direction
29     * {String} in {'North', 'South', 'East', 'West'}
30     */
31    direction: null,
32
33    /**
34     * Property: type
35     * {String} The type of <OpenLayers.Control> -- When added to a
36     *     <Control.Panel>, 'type' is used by the panel to determine how to
37     *     handle our events.
38     */
39    type: OpenLayers.Control.TYPE_BUTTON,
40
41    /**
42     * Constructor: OpenLayers.Control.Pan
43     * Control which handles the panning (in any of the cardinal directions)
44     *     of the map by a set px distance.
45     *
46     * Parameters:
47     * direction - {String} The direction this button should pan.
48     * options - {Object} An optional object whose properties will be used
49     *     to extend the control.
50     */
51    initialize: function(direction, options) {
52   
53        this.direction = direction;
54        this.CLASS_NAME += this.direction;
55       
56        OpenLayers.Control.prototype.initialize.apply(this, [options]);
57    },
58   
59    /**
60     * Method: trigger
61     */
62    trigger: function(){
63   
64        switch (this.direction) {
65            case OpenLayers.Control.Pan.NORTH: 
66                this.map.pan(0, -this.slideFactor);
67                break;
68            case OpenLayers.Control.Pan.SOUTH: 
69                this.map.pan(0, this.slideFactor);
70                break;
71            case OpenLayers.Control.Pan.WEST: 
72                this.map.pan(-this.slideFactor, 0);
73                break;
74            case OpenLayers.Control.Pan.EAST: 
75                this.map.pan(this.slideFactor, 0);
76                break;
77        }
78    },
79
80    CLASS_NAME: "OpenLayers.Control.Pan"
81});
82
83OpenLayers.Control.Pan.NORTH = "North";
84OpenLayers.Control.Pan.SOUTH = "South";
85OpenLayers.Control.Pan.EAST = "East";
86OpenLayers.Control.Pan.WEST = "West";
Note: See TracBrowser for help on using the repository browser.