]> git.openstreetmap.org Git - rails.git/blob - app/assets/javascripts/leaflet.key.js
Arrange and group map buttons
[rails.git] / app / assets / javascripts / leaflet.key.js
1 L.OSM.Key = L.Control.extend({
2   onAdd: function (map) {
3     this._map = map;
4     this._initLayout();
5     return this.$container[0];
6   },
7
8   _initLayout: function () {
9     var map = this._map;
10
11     this.$container = $('<div>')
12       .attr('class', 'control-key');
13
14     var link = $('<a>')
15       .attr('class', 'control-button')
16       .attr('href', '#')
17       .attr('title', 'Map Key')
18       .html('<span class="icon key"></span>')
19       .appendTo(this.$container);
20   }
21 });
22
23 L.OSM.key = function(options) {
24   return new L.OSM.Key(options);
25 };