From 22a27e0cb60d2909f4e2159da1c6f50ed9b4c5a6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 20 Feb 2017 17:24:12 +0100 Subject: JS: add helpers - get_zoom and zoom to a specific zoom level --- chimere/static/chimere/js/jquery.chimere.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 9ec3e48..44f17e0 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -1662,6 +1662,9 @@ function category_loaded_callback(cat_numbers){ settings.map.setCenter(f.lonlat); } }, + get_zoom: function () { + return settings.map.zoom; + }, zoom: function (options) { if ($.hasattr("category", options)) { helpers.zoom_to_category(options["category"]); @@ -1669,6 +1672,8 @@ function category_loaded_callback(cat_numbers){ helpers.zoom_to_subcategories(options["subcategories"]); } else if ($.hasattr("area", options)) { helpers.zoom_to_area(options["area"]); + } else if ($.hasattr("level", options)) { + settings.map.moveTo(settings.map.getCenter(), options['level']); } }, open_dialog: function(title, content){ -- cgit v1.2.3