diff --git a/roles/osm-vector/defaults/main.yml b/roles/osm-vector/defaults/main.yml index 601b1ea2e..a7d364134 100644 --- a/roles/osm-vector/defaults/main.yml +++ b/roles/osm-vector/defaults/main.yml @@ -1,3 +1,3 @@ menu_def_dir: '{{ doc_root }}/js-menu/menu-files/menu-defs' -osm_vector_path: '{{ content_base }}/osm-vector' +osm_vector_path: '{{ content_base }}/www/osm-vector' iiab_osm_url : http://download.iiab.io/content/OSM/vector-tiles diff --git a/roles/osm-vector/files/osm_functions.js b/roles/osm-vector/files/osm_functions.js index f1e620b47..f78feb316 100644 --- a/roles/osm-vector/files/osm_functions.js +++ b/roles/osm-vector/files/osm_functions.js @@ -7,7 +7,7 @@ var regionGeojson = {}; var regionList = []; var regionInstalled = []; var commonAssetsDir = '/common/assets/'; -var mapAssetsDir = '/osm-vector/assets/'; +var mapAssetsDir = '/osm-vector/maplist/assets/'; var iiab_config_dir = '/etc/iiab/'; var onChangeFunc = "setSize"; var osmCatalog = {}; @@ -138,9 +138,9 @@ function jsonErrhandler (jqXHR, textStatus, errorThrown) displayServerCommandStatus("Json Errhandler: " + textStatus + ", " + errorThrown); } //consoleLog("In Error Handler logging jqXHR"); - consoleLog(textStatus); - consoleLog(errorThrown); - consoleLog(jqXHR); + console.log(textStatus); + console.log(errorThrown); + console.log(jqXHR); return false; } diff --git a/roles/osm-vector/files/test-index.redirect b/roles/osm-vector/files/test-index.redirect index 0f3eb702e..bc2310bcc 100644 --- a/roles/osm-vector/files/test-index.redirect +++ b/roles/osm-vector/files/test-index.redirect @@ -1,5 +1,4 @@ - +
+ + diff --git a/roles/osm-vector/tasks/main.yml b/roles/osm-vector/tasks/main.yml index b74ebc7b6..b2cb5a963 100644 --- a/roles/osm-vector/tasks/main.yml +++ b/roles/osm-vector/tasks/main.yml @@ -1,31 +1,31 @@ -- name: Fetch the catalog for osm maps - get_url: - url: "{{ iiab_osm_url }}/assets/regions.json" - dest: '{{ osm_vector_path }}/assets' - - name: Make sure the osm-vector directory exists file: - path: '{{ osm_vector_path }}/assets' + path: '{{ osm_vector_path }}/maplist/assets' state: directory owner: '{{ apache_user }}' group: '{{ apache_user }}' mode: '0755' +- name: Fetch the catalog for osm maps + get_url: + url: "{{ iiab_osm_url }}/assets/regions.json" + dest: '{{ osm_vector_path }}/maplist/assets/' + - name: Fetch the javascript bundle with openlayers for test page get_url: url: "{{ iiab_osm_url }}/assets/main.js" - dest: '{{ osm_vector_path }}/assets' + dest: '{{ osm_vector_path }}/maplist/' - name: Fetch the index.html for test page template: src: "index.html" - dest: '{{ osm_vector_path }}/assets/index.html' + dest: '{{ osm_vector_path }}/maplist/index.html' # Wanted to generate on the fly. But geofabrik has non-rectangular bboxes - name: Fetch the bounding box description for osm maps get_url: url: "{{ iiab_osm_url }}/assets/bboxes.geojson" - dest: '{{ osm_vector_path }}/assets/' + dest: '{{ osm_vector_path }}/maplist/assets/' - name: Install a package that helps with geojson package: @@ -45,13 +45,13 @@ - name: Copy the Countries geojson to assets copy: src: countries.json - dest: '{{ osm_vector_path }}/assets' + dest: '{{ osm_vector_path }}/maplist/assets' # It is too complicated to use a single file for both iiab and admin-console - name: Copy the duplicated javascript to assets copy: src: osm_functions.js - dest: '{{ osm_vector_path }}/assets' + dest: '{{ osm_vector_path }}/maplist/assets' - name: Install /etc/{{ apache_config_dir }}/osm-vect.conf from template template: diff --git a/roles/osm-vector/templates/iiab-update-osm b/roles/osm-vector/templates/iiab-update-osm index dca77a52c..b4568fadf 100755 --- a/roles/osm-vector/templates/iiab-update-osm +++ b/roles/osm-vector/templates/iiab-update-osm @@ -23,7 +23,7 @@ doc_root = get_iiab_env('WWWROOT') menuDefs = doc_root + "/js-menu/menu-files/menu-defs/" osm_vector_idx_dir = doc_root + "/common/assets" #map_doc_root = '{{ osm_vector_path }}' -map_doc_root = '/library/osm-vector' +map_doc_root = '/library/www/osm-vector' # map_catalog will be global, assumed always available map_catalog = {} map_menu_def_list = [] @@ -56,7 +56,7 @@ def main(): def get_map_catalog(): global map_catalog - input_json = map_doc_root + '/assets/regions.json' + input_json = map_doc_root + '/maplist/assets/regions.json' with open(input_json,'r') as regions: reg_str = regions.read() map_catalog = json.loads(reg_str) diff --git a/roles/osm-vector/templates/index.html b/roles/osm-vector/templates/index.html index 3bd846a45..ee7592eea 100644 --- a/roles/osm-vector/templates/index.html +++ b/roles/osm-vector/templates/index.html @@ -4,6 +4,8 @@