25.08.2010, 06:05
Zeit fehlt mir halt auch... ;-) Das Beispiel hier sieht gut aus:
* first set of options is for the visual overlay.*/
var boxStyleOpts = {
opacity:.2,
border:"2px solid red"
}
/* second set of options is for everything else */
var otherOpts = {
buttonHTML:"<img src='zoom-button.gif' />",
buttonZoomingHTML:"<img src='zoom-button-activated.gif' />",
buttonStartingStyle:{width:'24px',height:'24px'}
};
/* third set of options specifies callbacks */
var callbacks = {
buttonclick:function(){display("Looks like you activated DragZoom!")},
dragstart:function(){display("Started to Drag . . .")},
dragging:function(x1,y1,x2,y2){display("Dragging, currently x="+x2+",y="+y2)},
dragend:function(nw,ne,se,sw,nwpx,nepx,sepx,swpx){display("Zoom! NE="+ne+";SW="+sw)}
};
map.addControl(new DragZoomControl(boxStyleOpts, otherOpts, callbacks));
* first set of options is for the visual overlay.*/
var boxStyleOpts = {
opacity:.2,
border:"2px solid red"
}
/* second set of options is for everything else */
var otherOpts = {
buttonHTML:"<img src='zoom-button.gif' />",
buttonZoomingHTML:"<img src='zoom-button-activated.gif' />",
buttonStartingStyle:{width:'24px',height:'24px'}
};
/* third set of options specifies callbacks */
var callbacks = {
buttonclick:function(){display("Looks like you activated DragZoom!")},
dragstart:function(){display("Started to Drag . . .")},
dragging:function(x1,y1,x2,y2){display("Dragging, currently x="+x2+",y="+y2)},
dragend:function(nw,ne,se,sw,nwpx,nepx,sepx,swpx){display("Zoom! NE="+ne+";SW="+sw)}
};
map.addControl(new DragZoomControl(boxStyleOpts, otherOpts, callbacks));
--
Christian
Christian