Add spinner while awaiting route
This commit is contained in:
parent
bf895a0332
commit
902f1b0887
3 changed files with 6 additions and 3 deletions
BIN
app/assets/images/searching-small.gif
Normal file
BIN
app/assets/images/searching-small.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -9,8 +9,6 @@
|
||||||
*** translation (including all alerts and presentation)
|
*** translation (including all alerts and presentation)
|
||||||
*** export GPX
|
*** export GPX
|
||||||
*** URL history (or do we consciously not want to support that?)
|
*** URL history (or do we consciously not want to support that?)
|
||||||
*** spinner when waiting for result (beneath 'Go' button?)
|
|
||||||
|
|
||||||
*** add YOURS engine
|
*** add YOURS engine
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -161,6 +159,7 @@ OSM.Routing=function(map,name,jqSearch) {
|
||||||
|
|
||||||
r.requestRoute=function(isFinal, updateZoom) {
|
r.requestRoute=function(isFinal, updateZoom) {
|
||||||
if (r.route_from && r.route_to) {
|
if (r.route_from && r.route_to) {
|
||||||
|
$(".query_wrapper.routing .spinner").show();
|
||||||
r.awaitingRoute=true;
|
r.awaitingRoute=true;
|
||||||
r.chosenEngine.getRoute(isFinal,[r.route_from,r.route_to]);
|
r.chosenEngine.getRoute(isFinal,[r.route_from,r.route_to]);
|
||||||
if(updateZoom){
|
if(updateZoom){
|
||||||
|
@ -247,7 +246,10 @@ OSM.Routing=function(map,name,jqSearch) {
|
||||||
script.src = url+r.name+".gotRoute"+num;
|
script.src = url+r.name+".gotRoute"+num;
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
};
|
};
|
||||||
r['gotRoute'+num]=function(data) { r.awaitingRoute=false; list[num].gotRoute(r,data); };
|
r['gotRoute'+num]=function(data) {
|
||||||
|
r.awaitingRoute=false; list[num].gotRoute(r,data);
|
||||||
|
$(".query_wrapper.routing .spinner").hide();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
select.append("<option value='"+i+"'>"+I18n.t(list[i].name)+"</option>");
|
select.append("<option value='"+i+"'>"+I18n.t(list[i].name)+"</option>");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<%= image_tag "marker-red.png" , :class => 'routing_marker', :id => 'marker_to' , :draggable => 'true' %>
|
<%= image_tag "marker-red.png" , :class => 'routing_marker', :id => 'marker_to' , :draggable => 'true' %>
|
||||||
<%= text_field_tag "route_to" , params[:to] , :placeholder => t('site.search.to') , :onchange=>"OSM.routing.geocode('route_to' ,event)" %>
|
<%= text_field_tag "route_to" , params[:to] , :placeholder => t('site.search.to') , :onchange=>"OSM.routing.geocode('route_to' ,event)" %>
|
||||||
<select class='routing_engines' name='routing_engines' onchange="OSM.routing.selectEngine(event)"></select>
|
<select class='routing_engines' name='routing_engines' onchange="OSM.routing.selectEngine(event)"></select>
|
||||||
|
<%= image_tag "searching-small.gif", :class => 'spinner', :style => "vertical-align: middle; display: none;" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue