Use larger 'spinner' when waiting for route request. Replace HTML in content to avoid resize.
This commit is contained in:
parent
376a630756
commit
5afe47e3f6
2 changed files with 6 additions and 6 deletions
|
@ -166,14 +166,16 @@ OSM.Directions = function (map) {
|
||||||
d.lat.toFixed(precision) + ',' + d.lng.toFixed(precision)
|
d.lat.toFixed(precision) + ',' + d.lng.toFixed(precision)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$(".directions_form .spinner").show();
|
// copy loading item to sidebar and display it. we copy it, rather than
|
||||||
|
// just using it in-place and replacing it in case it has to be used
|
||||||
|
// again.
|
||||||
|
$('#sidebar_content').html($('.directions_form .loader_copy').html());
|
||||||
awaitingRoute = true;
|
awaitingRoute = true;
|
||||||
|
map.setSidebarOverlaid(false);
|
||||||
|
|
||||||
chosenEngine.getRoute([o, d], function (err, route) {
|
chosenEngine.getRoute([o, d], function (err, route) {
|
||||||
awaitingRoute = false;
|
awaitingRoute = false;
|
||||||
|
|
||||||
$(".directions_form .spinner").hide();
|
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
map.removeLayer(polyline);
|
map.removeLayer(polyline);
|
||||||
|
|
||||||
|
@ -188,8 +190,6 @@ OSM.Directions = function (map) {
|
||||||
.setLatLngs(route.line)
|
.setLatLngs(route.line)
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
map.setSidebarOverlaid(false);
|
|
||||||
|
|
||||||
if (!dragging) {
|
if (!dragging) {
|
||||||
map.fitBounds(polyline.getBounds().pad(0.05));
|
map.fitBounds(polyline.getBounds().pad(0.05));
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,6 @@
|
||||||
</div>
|
</div>
|
||||||
<select class='routing_engines' name='routing_engines'></select>
|
<select class='routing_engines' name='routing_engines'></select>
|
||||||
<div width="100%" align="right"><%= submit_tag t('site.search.submit_text') %></div>
|
<div width="100%" align="right"><%= submit_tag t('site.search.submit_text') %></div>
|
||||||
<%= image_tag "searching-small.gif", :class => 'spinner', :style => "vertical-align: middle; display: none;" %>
|
<div class="loader_copy" style="display:none;"><div class="loader"><%= image_tag "searching.gif", :style => "vertical-align: middle;" %></div></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue