[OpenLayers-Dev] disabled move in Y

Xavier Mamano (jorix) xavier.mamano at gmail.com
Tue Feb 11 13:59:26 PST 2014


Hi,

For OL2 try:

var navCtl = new OpenLayers.Control.Navigation();
map.addControl(navCtl); // this must be written before the tricks!!

// Trick for pan
var evtTrick = function (evt) {
    evt.xy = new OpenLayers.Pixel(evt.xy.x, this.last.y);
};
var navCtlPanHnd = navCtl.dragPan.handler;
navCtlPanHnd.move = evtTrick;
navCtlPanHnd.up = evtTrick;
navCtlPanHnd.out = evtTrick;

// Trick for zoom
var evtTrick2 = function (evt) {
    evt.xy = new OpenLayers.Pixel(this.last.x, evt.xy.y);
};
var navCtlZboxHnd = navCtl.zoomBox.handler.dragHandler;
navCtlZboxHnd.move = evtTrick2;
navCtlZboxHnd.up = evtTrick2;
navCtlZboxHnd.out = evtTrick2;

regards,



lenoil wrote
> Hi,
> 
> OL2  : Openlayers 2
> OL3 : Openlayers 3
> it possible to disabled the move in Y or in Y ? OL2 or OL3 ?
> Is it possible to zoom only on the X, only on the Y  ? OL2 or OL3 ?
> 
> Thanks for your help because I 'm lost





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/disabled-move-in-Y-tp5099809p5103256.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.


More information about the Dev mailing list