use button elements instead of anchor elements and add tooltips to zoomcontrol

This commit is contained in:
Mark Prins
2014-02-15 10:38:14 +01:00
committed by Antoine Abt
parent 9adf8b01f6
commit 18c2ffe522
2 changed files with 13 additions and 11 deletions

View File

@@ -38,26 +38,28 @@ ol.control.Zoom = function(opt_options) {
options.zoomOutLabel : '\u2212';
var tTipZoomIn = goog.dom.createDom(goog.dom.TagName.SPAN, {
'class':'',
'role':'tooltip'
},"Zoom in");
'class': '',
'role' : 'tooltip'
}, 'Zoom in');
var inElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'class': className + '-in olHasToolTip',
'name' : 'zoomIn'
'name' : 'ZoomIn',
'type' : 'button'
}, tTipZoomIn, zoomInLabel);
goog.events.listen(inElement, [
goog.events.EventType.TOUCHEND,
goog.events.EventType.CLICK
], goog.partial(ol.control.Zoom.prototype.zoomByDelta_, delta), false, this);
var tTipsZoomOut = goog.dom.createDom(goog.dom.TagName.SPAN, {
'class':'',
'role':'tooltip'
}, "Zoom out");
'class': '',
'role' : 'tooltip',
'type' : 'button'
}, 'Zoom out');
var outElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'class': className + '-out olHasToolTip',
'name' : 'zoomOut'
'name' : 'ZoomOut'
}, tTipsZoomOut, zoomOutLabel);
goog.events.listen(outElement, [
goog.events.EventType.TOUCHEND,