1 L.OSM.query = function (options) {
2 var control = L.control(options);
4 control.onAdd = function (map) {
5 var $container = $('<div>')
6 .attr('class', 'control-query');
9 .attr('class', 'control-button')
11 .html('<span class="icon query"></span>')
12 .appendTo($container);
14 map.on('zoomend', update);
19 var wasDisabled = link.hasClass('disabled'),
20 isDisabled = map.getZoom() < 14;
22 .toggleClass('disabled', isDisabled)
23 .attr('data-original-title', I18n.t(isDisabled ?
24 'javascripts.site.queryfeature_disabled_tooltip' :
25 'javascripts.site.queryfeature_tooltip'));
27 if (isDisabled && !wasDisabled) {
28 link.trigger('disabled');
29 } else if (wasDisabled && !isDisabled) {
30 link.trigger('enabled');