Skip to content

Commit 02b2eda

Browse files
author
perliedman
committed
Added throbber
1 parent 62a6ae0 commit 02b2eda

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Control.Geocoder.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ a.leaflet-control-geocoder-toggle {
1515
height: 36px;
1616
}
1717

18+
a.leaflet-control-geocoder-throbber {
19+
background-image: url(images/throbber.gif);
20+
}
21+
1822
.leaflet-touch .leaflet-control-geocoder a {
1923
width: 44px;
2024
height: 44px;

Control.Geocoder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ L.Control.Geocoder = L.Control.extend({
7070
},
7171

7272
_geocodeResult: function (results) {
73+
var toggle = document.getElementsByClassName('leaflet-control-geocoder-toggle')[0];
74+
toggle.className = toggle.className.replace(' leaflet-control-geocoder-throbber', '')
7375
if (results.length == 1) {
7476
this.options.markGeocode(results[0]);
7577
} else if (results.length > 0) {
@@ -110,6 +112,8 @@ L.Control.Geocoder = L.Control.extend({
110112
},
111113

112114
_geocode: function(event) {
115+
var toggle = document.getElementsByClassName('leaflet-control-geocoder-toggle')[0];
116+
toggle.className += ' leaflet-control-geocoder-throbber';
113117
this._clearResults();
114118
L.DomEvent.preventDefault(event);
115119
this.geocode(this._input.value);

images/throbber.gif

4.72 KB
Loading

0 commit comments

Comments
 (0)