From d63d10c1d256537cc24faaf43ac650e8d7c9f6fe Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 11 Oct 2016 11:30:25 +0200 Subject: Routing: add clear - improve icons and styles --- chimere/static/chimere/css/styles.css | 40 +++++++++++++++++++++++ chimere/static/chimere/img/center.png | Bin 846 -> 0 bytes chimere/static/chimere/img/icon-add-step-off.png | Bin 0 -> 446 bytes chimere/static/chimere/img/icon-add-step.png | Bin 0 -> 427 bytes chimere/static/chimere/img/icon-center-off.png | Bin 0 -> 678 bytes chimere/static/chimere/img/icon-center.png | Bin 0 -> 846 bytes chimere/static/chimere/img/icon-from-off.png | Bin 0 -> 177 bytes chimere/static/chimere/img/icon-from.png | Bin 0 -> 177 bytes chimere/static/chimere/img/icon-times-off.png | Bin 0 -> 1004 bytes chimere/static/chimere/img/icon-times.png | Bin 0 -> 1256 bytes chimere/static/chimere/img/icon-to-off.png | Bin 0 -> 182 bytes chimere/static/chimere/img/icon-to.png | Bin 0 -> 182 bytes chimere/static/chimere/img/icon_from.png | Bin 177 -> 0 bytes chimere/static/chimere/img/icon_to.png | Bin 177 -> 0 bytes chimere/static/chimere/js/jquery.chimere.js | 23 ++++++++----- 15 files changed, 54 insertions(+), 9 deletions(-) delete mode 100644 chimere/static/chimere/img/center.png create mode 100644 chimere/static/chimere/img/icon-add-step-off.png create mode 100644 chimere/static/chimere/img/icon-add-step.png create mode 100644 chimere/static/chimere/img/icon-center-off.png create mode 100644 chimere/static/chimere/img/icon-center.png create mode 100644 chimere/static/chimere/img/icon-from-off.png create mode 100644 chimere/static/chimere/img/icon-from.png create mode 100644 chimere/static/chimere/img/icon-times-off.png create mode 100644 chimere/static/chimere/img/icon-times.png create mode 100644 chimere/static/chimere/img/icon-to-off.png create mode 100644 chimere/static/chimere/img/icon-to.png delete mode 100644 chimere/static/chimere/img/icon_from.png delete mode 100644 chimere/static/chimere/img/icon_to.png diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css index fd573d4..cdcf437 100644 --- a/chimere/static/chimere/css/styles.css +++ b/chimere/static/chimere/css/styles.css @@ -1835,3 +1835,43 @@ span#permalink, .navbar-nav .lbl, #areas-div label, #permalink, #simple_button, .ol-ctx-menu-container li.ol-ctx-menu-separator hr{ margin: 5px; } + +.ol-ctx-menu-center{ + background-image: url("../img/icon-center.png"); +} + +.ol-ctx-menu-center:hover{ + background-image: url("../img/icon-center-off.png"); +} + +.ol-ctx-menu-to{ + background-image: url("../img/icon-to.png"); +} + +.ol-ctx-menu-to:hover{ + background-image: url("../img/icon-to-off.png"); +} + +.ol-ctx-menu-from{ + background-image: url("../img/icon-from.png"); +} + +.ol-ctx-menu-from:hover{ + background-image: url("../img/icon-from-off.png"); +} + +.ol-ctx-menu-add-step{ + background-image: url("../img/icon-add-step.png"); +} + +.ol-ctx-menu-add-step:hover{ + background-image: url("../img/icon-add-step-off.png"); +} + +.ol-ctx-menu-rout-clean{ + background-image: url("../img/icon-times.png"); +} + +.ol-ctx-menu-rout-clean:hover{ + background-image: url("../img/icon-times-off.png"); +} diff --git a/chimere/static/chimere/img/center.png b/chimere/static/chimere/img/center.png deleted file mode 100644 index fad2f26..0000000 Binary files a/chimere/static/chimere/img/center.png and /dev/null differ diff --git a/chimere/static/chimere/img/icon-add-step-off.png b/chimere/static/chimere/img/icon-add-step-off.png new file mode 100644 index 0000000..c76c8c2 Binary files /dev/null and b/chimere/static/chimere/img/icon-add-step-off.png differ diff --git a/chimere/static/chimere/img/icon-add-step.png b/chimere/static/chimere/img/icon-add-step.png new file mode 100644 index 0000000..0ce96b3 Binary files /dev/null and b/chimere/static/chimere/img/icon-add-step.png differ diff --git a/chimere/static/chimere/img/icon-center-off.png b/chimere/static/chimere/img/icon-center-off.png new file mode 100644 index 0000000..cd53889 Binary files /dev/null and b/chimere/static/chimere/img/icon-center-off.png differ diff --git a/chimere/static/chimere/img/icon-center.png b/chimere/static/chimere/img/icon-center.png new file mode 100644 index 0000000..fad2f26 Binary files /dev/null and b/chimere/static/chimere/img/icon-center.png differ diff --git a/chimere/static/chimere/img/icon-from-off.png b/chimere/static/chimere/img/icon-from-off.png new file mode 100644 index 0000000..6eec824 Binary files /dev/null and b/chimere/static/chimere/img/icon-from-off.png differ diff --git a/chimere/static/chimere/img/icon-from.png b/chimere/static/chimere/img/icon-from.png new file mode 100644 index 0000000..20cc9f3 Binary files /dev/null and b/chimere/static/chimere/img/icon-from.png differ diff --git a/chimere/static/chimere/img/icon-times-off.png b/chimere/static/chimere/img/icon-times-off.png new file mode 100644 index 0000000..7c08877 Binary files /dev/null and b/chimere/static/chimere/img/icon-times-off.png differ diff --git a/chimere/static/chimere/img/icon-times.png b/chimere/static/chimere/img/icon-times.png new file mode 100644 index 0000000..5fd2747 Binary files /dev/null and b/chimere/static/chimere/img/icon-times.png differ diff --git a/chimere/static/chimere/img/icon-to-off.png b/chimere/static/chimere/img/icon-to-off.png new file mode 100644 index 0000000..851d39b Binary files /dev/null and b/chimere/static/chimere/img/icon-to-off.png differ diff --git a/chimere/static/chimere/img/icon-to.png b/chimere/static/chimere/img/icon-to.png new file mode 100644 index 0000000..2a0a80e Binary files /dev/null and b/chimere/static/chimere/img/icon-to.png differ diff --git a/chimere/static/chimere/img/icon_from.png b/chimere/static/chimere/img/icon_from.png deleted file mode 100644 index 3623e50..0000000 Binary files a/chimere/static/chimere/img/icon_from.png and /dev/null differ diff --git a/chimere/static/chimere/img/icon_to.png b/chimere/static/chimere/img/icon_to.png deleted file mode 100644 index 6a2bab2..0000000 Binary files a/chimere/static/chimere/img/icon_to.png and /dev/null differ diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 38698bc..5d2cc4d 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -22,6 +22,7 @@ var labels = { 'routing_from': "From", 'routing_to': "To", 'routing_add_step': "Add step", + 'routing_clean': "Delete the route", 'center_map': "Center map here", 'zoom_in': "Zoom in", 'zoom_out': "Zoom out" @@ -33,6 +34,7 @@ if (typeof language != 'undefined'){ 'routing_from': "En partir", 'routing_to': "Y aller", 'routing_add_step': "Ajouter une étape", + 'routing_clean': "Effacer l'itinéraire", 'center_map': "Centrer la carte ici", 'zoom_in': "Zoom avant", 'zoom_out': "Zoom arrière" @@ -392,17 +394,22 @@ function transformCoordToLonLat(coord) { { text: labels['routing_from'], callback: methods.routingFrom, - icon: STATIC_URL + 'chimere/img/icon_from.png' + classname: 'ol-ctx-menu-from ol-ctx-menu-icon' }, { text: labels['routing_add_step'], callback: methods.routingAddStep, - icon: STATIC_URL + 'chimere/img/icon_add_step.png' + classname: 'ol-ctx-menu-add-step ol-ctx-menu-icon' }, { text: labels['routing_to'], callback: methods.routingTo, - icon: STATIC_URL + 'chimere/img/icon_to.png' + classname: 'ol-ctx-menu-to ol-ctx-menu-icon' + }, + { + text: labels['routing_clean'], + callback: methods.routingClear, + classname: 'ol-ctx-menu-rout-clean ol-ctx-menu-icon' }, '-']; } @@ -410,7 +417,7 @@ function transformCoordToLonLat(coord) { { text: labels['center_map'], callback: methods.mapCenter, - icon: STATIC_URL + 'chimere/img/center.png' + classname: 'ol-ctx-menu-center ol-ctx-menu-icon' }, '-', { @@ -2303,20 +2310,18 @@ function transformCoordToLonLat(coord) { $('#nominatim_end_label').html(''); $('#chimere_end_label').html(''); $('.nominatim-widget').val(default_nominatim_lbl); - $('#chimere_map_menu').hide(); - $('#map_menu_clear').hide(); $('#chimere_itinerary').hide(); $('#chimere_itinerary_form').show(); $('div[id^="id_step_"]').remove(); if($('#search_routing').length) $('#search_routing').button('disable'); - settings.layerRoute.removeAllFeatures(); - settings.layerRouteMarker.clearMarkers(); settings.routing_start = null; settings.routing_end = null; settings.routing_steps = new Array(); settings.current_itinerary_number = 0; settings.current_routes_features = []; - settings.permalink.updateLink(); + settings.routingFeatures.clear(); + // TODO ol3 + // settings.permalink.updateLink(); }, // display a route route: function(){ -- cgit v1.2.3