diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml index b51360ae4..48b036cfc 100644 --- a/roles/4-server-options/tasks/main.yml +++ b/roles/4-server-options/tasks/main.yml @@ -15,8 +15,8 @@ - name: Installing vector map test page include_role: - name: map-vector - when: map_vector_install + name: vector-map + when: vector_map_install tags: base, map - name: Installing captive portal diff --git a/roles/map-vector/defaults/main.yml b/roles/map-vector/defaults/main.yml index 1b51987f2..d68b225b3 100644 --- a/roles/map-vector/defaults/main.yml +++ b/roles/map-vector/defaults/main.yml @@ -1,6 +1,6 @@ -map_vector_install: True -map_vector_enabled: True -map_vector_path: '{{ content_base }}/www/map-vector' +vector_map_install: True +vector_map_enabled: True +vector_map_path: '{{ content_base }}/www/vector-map' # All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml # If nec, change them by editing /etc/iiab/local_vars.yml prior to installing! diff --git a/roles/map-vector/files/osm_functions.js b/roles/map-vector/files/osm_functions.js index a0f958dc2..ed59e4807 100644 --- a/roles/map-vector/files/osm_functions.js +++ b/roles/map-vector/files/osm_functions.js @@ -7,7 +7,7 @@ var regionGeojson = {}; var regionList = []; var regionInstalled = []; var commonAssetsDir = '/common/assets/'; -var mapAssetsDir = '/map-vector/maplist/assets/'; +var mapAssetsDir = '/vector-map/maplist/assets/'; var iiab_config_dir = '/etc/iiab/'; var onChangeFunc = "setSize"; var osmCatalog = {}; @@ -27,7 +27,7 @@ function readOsmIdx(){ //consoleLog ("in readOsmIdx"); var resp = $.ajax({ type: 'GET', - url: consoleJsonDir + 'map-vector-idx.json', + url: consoleJsonDir + 'vector-map-idx.json', dataType: 'json' }) .done(function( data ) { diff --git a/roles/map-vector/files/test-index.redirect b/roles/map-vector/files/test-index.redirect index 5b2af4a6f..68cd166c6 100644 --- a/roles/map-vector/files/test-index.redirect +++ b/roles/map-vector/files/test-index.redirect @@ -1,4 +1,4 @@ - + diff --git a/roles/map-vector/tasks/main.yml b/roles/map-vector/tasks/main.yml index 3a09b2f9a..e15b7d30d 100644 --- a/roles/map-vector/tasks/main.yml +++ b/roles/map-vector/tasks/main.yml @@ -1,6 +1,6 @@ -- name: Make sure the map-vector directory exists +- name: Make sure the vector-map directory exists file: - path: '{{ map_vector_path }}/maplist/assets' + path: '{{ vector_map_path }}/maplist/assets' state: directory owner: '{{ apache_user }}' group: '{{ apache_user }}' @@ -9,30 +9,30 @@ - name: Fetch the catalog for osm maps get_url: url: "{{ iiab_osm_url }}/assets/regions.json" - dest: '{{ map_vector_path }}/maplist/assets/' + dest: '{{ vector_map_path }}/maplist/assets/' - name: Create a link to osm catalog in /common/assets file: - src: "{{ map_vector_path }}/maplist/assets/regions.json" + src: "{{ vector_map_path }}/maplist/assets/regions.json" dest: "{{ doc_root }}/common/assets/regions.json" state: link - name: Fetch the javascript bundle with openlayers for test page get_url: url: "{{ iiab_osm_url }}/../main.js" - dest: '{{ map_vector_path }}/maplist/' + dest: '{{ vector_map_path }}/maplist/' - name: Fetch the index.html for test page template: src: "index.html" - dest: '{{ map_vector_path }}/maplist/index.html' + dest: '{{ vector_map_path }}/maplist/index.html' # Bboxes (bounding boxes) are currently square. But geofabrik has non-rectangular bboxes. # So bring the bounding box definition from cloud (bboxes.geojson is big) - name: Fetch the bounding box description for osm maps get_url: url: "{{ iiab_osm_url }}/assets/bboxes.geojson" - dest: '{{ map_vector_path }}/maplist/assets/' + dest: '{{ vector_map_path }}/maplist/assets/' - name: Install python-geojson package, that helps with geojson package: @@ -45,40 +45,40 @@ dest: /usr/bin/iiab-update-osm mode: "0755" -- name: Run the script that does map-vector housekeeping +- name: Run the script that does vector-map housekeeping shell: /usr/bin/iiab-update-osm - name: Copy the Countries geojson to assets copy: src: countries.json - dest: '{{ map_vector_path }}/maplist/assets' + dest: '{{ vector_map_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: '{{ map_vector_path }}/maplist/assets' + dest: '{{ vector_map_path }}/maplist/assets' - name: Install /etc/{{ apache_config_dir }}/osm-vect.conf from template template: - src: map-vector.conf - dest: "/etc/{{ apache_config_dir }}/map-vector.conf" + src: vector-map.conf + dest: "/etc/{{ apache_config_dir }}/vector-map.conf" -- name: Create symlink map-vector.conf from sites-enabled to sites-available (debuntu, not nec for redhat) +- name: Create symlink vector-map.conf from sites-enabled to sites-available (debuntu, not nec for redhat) file: - src: /etc/apache2/sites-available/map-vector.conf - path: /etc/apache2/sites-enabled/map-vector.conf + src: /etc/apache2/sites-available/vector-map.conf + path: /etc/apache2/sites-enabled/vector-map.conf state: link - when: map_vector_enabled and is_debuntu + when: vector_map_enabled and is_debuntu -- name: Remove symlink /etc/apache2/sites-enabled/map-vector.conf (debuntu) +- name: Remove symlink /etc/apache2/sites-enabled/vector-map.conf (debuntu) file: - path: /etc/apache2/sites-enabled/map-vector.conf + path: /etc/apache2/sites-enabled/vector-map.conf state: absent - when: not map_vector_enabled and is_debuntu + when: not vector_map_enabled and is_debuntu - name: Copy the redirect to the test page -- delete this if more than one map copy: src: test-index.redirect - dest: "{{ map_vector_path }}/index.html" + dest: "{{ vector_map_path }}/index.html" diff --git a/roles/map-vector/templates/iiab-update-osm b/roles/map-vector/templates/iiab-update-osm index 4e5ed7905..817e6e6cd 100755 --- a/roles/map-vector/templates/iiab-update-osm +++ b/roles/map-vector/templates/iiab-update-osm @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Scan the map-vector directory, update the map-vector-idx.json, add menu-defs +# Scan the vector-map directory, update the vector-map-idx.json, add menu-defs from geojson import Feature, Point, FeatureCollection, Polygon import geojson @@ -25,9 +25,9 @@ else: doc_root = get_iiab_env('WWWROOT') menuDefs = doc_root + "/js-menu/menu-files/menu-defs/" -map_vector_idx_dir = doc_root + "/common/assets" -#map_doc_root = '{{ map_vector_path }}' -map_doc_root = '/library/www/map-vector' +vector_map_idx_dir = doc_root + "/common/assets" +#map_doc_root = '{{ vector_map_path }}' +map_doc_root = '/library/www/vector-map' # map_catalog will be global, assumed always available map_catalog = {} map_menu_def_list = [] @@ -43,7 +43,7 @@ def main(): installed_maps = get_installed_regions() print(installed_maps) - write_map_vector_idx(installed_maps) + write_vector_map_idx(installed_maps) # For installed regions, check that a menu def exists, and it's on home page for fname in installed_maps: @@ -106,7 +106,7 @@ def get_installed_regions(): installed.append('maplist') return installed -def write_map_vector_idx(installed_maps): +def write_vector_map_idx(installed_maps): map_dict ={} idx_dict = {} for fname in installed_maps: @@ -125,7 +125,7 @@ def write_map_vector_idx(installed_maps): idx_dict[item]['region'] = region idx_dict[item]['language'] = map_dict['perma_ref'][:2] - with open(map_vector_idx_dir + '/osm_version_idx.json','w') as idx: + with open(vector_map_idx_dir + '/osm_version_idx.json','w') as idx: idx.write(json.dumps(idx_dict,indent=2)) def create_menu_def(region,default_name,intended_use='map'): diff --git a/roles/map-vector/templates/index.html b/roles/map-vector/templates/index.html index bef8adf46..b00310b1a 100644 --- a/roles/map-vector/templates/index.html +++ b/roles/map-vector/templates/index.html @@ -46,12 +46,12 @@ return (bytes / Math.pow(1024, e)).toFixed(2) + " " + s[e]; } - + - + diff --git a/roles/map-vector/templates/map-vector.conf b/roles/map-vector/templates/map-vector.conf index e03739186..378127778 100644 --- a/roles/map-vector/templates/map-vector.conf +++ b/roles/map-vector/templates/map-vector.conf @@ -1,7 +1,7 @@ # For downloadable regional vector tilesets -Alias /maps {{ map_vector_path }} -Alias /map-vector {{ map_vector_path }} - +Alias /maps {{ vector_map_path }} +Alias /vector-map {{ vector_map_path }} + Options Indexes FollowSymLinks AllowOverride All Require all granted diff --git a/vars/default_vars.yml b/vars/default_vars.yml index c1fc1881c..b9f33c77c 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -352,9 +352,9 @@ mongodb_enabled: False mongodb_port: 27018 # Regional OSM vector maps use much less disk space than bitmap/raster versions -map_vector_install: True -map_vector_enabled: True -map_vector_path: '{{ content_base }}/www/map-vector' +vector_map_install: True +vector_map_enabled: True +vector_map_path: '{{ content_base }}/www/vector-map' # roles/sugarizer/meta/main.yml auto-invokes 2 above prereqs: mongodb & nodejs # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 7830a81e7..b62f272af 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -230,8 +230,8 @@ moodle_enabled: True # If using Moodle intensively, set apache_high_php_limits in 3-BASE-SERVER # Regional OSM vector maps use much less disk space than bitmap/raster versions -map_vector_install: True -map_vector_enabled: True +vector_map_install: True +vector_map_enabled: True # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 943a12283..e14f320a4 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -230,8 +230,8 @@ moodle_enabled: False # If using Moodle intensively, set apache_high_php_limits in 3-BASE-SERVER # Regional OSM vector maps use much less disk space than bitmap/raster versions -map_vector_install: True -map_vector_enabled: True +vector_map_install: True +vector_map_enabled: True # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 957f8cbe4..324651c26 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -230,8 +230,8 @@ moodle_enabled: False # If using Moodle intensively, set apache_high_php_limits in 3-BASE-SERVER # Regional OSM vector maps use much less disk space than bitmap/raster versions -map_vector_install: True -map_vector_enabled: True +vector_map_install: True +vector_map_enabled: True # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957