]> git.openstreetmap.org Git - rails.git/blob - app/assets/javascripts/leaflet.extend.js.erb
Remove geolink class from add note button while adding notes
[rails.git] / app / assets / javascripts / leaflet.extend.js.erb
1 L.extend(L.LatLngBounds.prototype, {
2   getSize: function () {
3     return (this._northEast.lat - this._southWest.lat) *
4            (this._northEast.lng - this._southWest.lng);
5   },
6
7   wrap: function () {
8     return new L.LatLngBounds(this._southWest.wrap(), this._northEast.wrap());
9   }
10 });
11
12 L.extend(L.Map.prototype, {
13     getLayersCode: function() {
14         var layerConfig = '';
15         for (var i in this._layers) { // TODO: map.eachLayer
16             var layer = this._layers[i];
17             if (layer.options && layer.options.code) {
18                 layerConfig += layer.options.code;
19             }
20         }
21         return layerConfig;
22     },
23     getMapBaseLayerId: function() {
24         for (var i in this._layers) { // TODO: map.eachLayer
25             var layer = this._layers[i];
26             if (layer.options && layer.options.keyid) return layer.options.keyid;
27         }
28     }
29 });
30
31 L.Icon.Default.imagePath = <%= "#{asset_prefix}/images".to_json %>;