diff --git a/roles/osm-vector/defaults/main.yml b/roles/map-vector/defaults/main.yml similarity index 69% rename from roles/osm-vector/defaults/main.yml rename to roles/map-vector/defaults/main.yml index b89c6a5bd..1b51987f2 100644 --- a/roles/osm-vector/defaults/main.yml +++ b/roles/map-vector/defaults/main.yml @@ -1,6 +1,6 @@ -osm_vector_install: True -osm_vector_enabled: True -osm_vector_path: '{{ content_base }}/www/osm-vector' +map_vector_install: True +map_vector_enabled: True +map_vector_path: '{{ content_base }}/www/map-vector' # 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/osm-vector/files/countries.json b/roles/map-vector/files/countries.json similarity index 100% rename from roles/osm-vector/files/countries.json rename to roles/map-vector/files/countries.json diff --git a/roles/osm-vector/files/en-map_test.json b/roles/map-vector/files/en-map_test.json similarity index 100% rename from roles/osm-vector/files/en-map_test.json rename to roles/map-vector/files/en-map_test.json diff --git a/roles/osm-vector/files/osm_functions.js b/roles/map-vector/files/osm_functions.js similarity index 98% rename from roles/osm-vector/files/osm_functions.js rename to roles/map-vector/files/osm_functions.js index 819b76ee1..a0f958dc2 100644 --- a/roles/osm-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 = '/osm-vector/maplist/assets/'; +var mapAssetsDir = '/map-vector/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 + 'osm-vector-idx.json', + url: consoleJsonDir + 'map-vector-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 new file mode 100644 index 000000000..5b2af4a6f --- /dev/null +++ b/roles/map-vector/files/test-index.redirect @@ -0,0 +1,4 @@ + + + + diff --git a/roles/osm-vector/tasks/main.yml b/roles/map-vector/tasks/main.yml similarity index 62% rename from roles/osm-vector/tasks/main.yml rename to roles/map-vector/tasks/main.yml index ce489cfa9..3a09b2f9a 100644 --- a/roles/osm-vector/tasks/main.yml +++ b/roles/map-vector/tasks/main.yml @@ -1,6 +1,6 @@ -- name: Make sure the osm-vector directory exists +- name: Make sure the map-vector directory exists file: - path: '{{ osm_vector_path }}/maplist/assets' + path: '{{ map_vector_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: '{{ osm_vector_path }}/maplist/assets/' + dest: '{{ map_vector_path }}/maplist/assets/' - name: Create a link to osm catalog in /common/assets file: - src: "{{ osm_vector_path }}/maplist/assets/regions.json" + src: "{{ map_vector_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: '{{ osm_vector_path }}/maplist/' + dest: '{{ map_vector_path }}/maplist/' - name: Fetch the index.html for test page template: src: "index.html" - dest: '{{ osm_vector_path }}/maplist/index.html' + dest: '{{ map_vector_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: '{{ osm_vector_path }}/maplist/assets/' + dest: '{{ map_vector_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 osm-vector housekeeping +- name: Run the script that does map-vector housekeeping shell: /usr/bin/iiab-update-osm - name: Copy the Countries geojson to assets copy: src: countries.json - dest: '{{ osm_vector_path }}/maplist/assets' + dest: '{{ map_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 }}/maplist/assets' + dest: '{{ map_vector_path }}/maplist/assets' - name: Install /etc/{{ apache_config_dir }}/osm-vect.conf from template template: - src: osm-vector.conf - dest: "/etc/{{ apache_config_dir }}/osm-vector.conf" + src: map-vector.conf + dest: "/etc/{{ apache_config_dir }}/map-vector.conf" -- name: Create symlink osm-vector.conf from sites-enabled to sites-available (debuntu, not nec for redhat) +- name: Create symlink map-vector.conf from sites-enabled to sites-available (debuntu, not nec for redhat) file: - src: /etc/apache2/sites-available/osm-vector.conf - path: /etc/apache2/sites-enabled/osm-vector.conf + src: /etc/apache2/sites-available/map-vector.conf + path: /etc/apache2/sites-enabled/map-vector.conf state: link - when: osm_vector_enabled and is_debuntu + when: map_vector_enabled and is_debuntu -- name: Remove symlink /etc/apache2/sites-enabled/osm-vector.conf (debuntu) +- name: Remove symlink /etc/apache2/sites-enabled/map-vector.conf (debuntu) file: - path: /etc/apache2/sites-enabled/osm-vector.conf + path: /etc/apache2/sites-enabled/map-vector.conf state: absent - when: not osm_vector_enabled and is_debuntu + when: not map_vector_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: "{{ osm_vector_path }}/index.html" + dest: "{{ map_vector_path }}/index.html" diff --git a/roles/osm-vector/templates/iiab-update-osm b/roles/map-vector/templates/iiab-update-osm similarity index 95% rename from roles/osm-vector/templates/iiab-update-osm rename to roles/map-vector/templates/iiab-update-osm index 8d8758e21..4e5ed7905 100755 --- a/roles/osm-vector/templates/iiab-update-osm +++ b/roles/map-vector/templates/iiab-update-osm @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Scan the osm-vector directory, update the osm-vector-idx.json, add menu-defs +# Scan the map-vector directory, update the map-vector-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/" -osm_vector_idx_dir = doc_root + "/common/assets" -#map_doc_root = '{{ osm_vector_path }}' -map_doc_root = '/library/www/osm-vector' +map_vector_idx_dir = doc_root + "/common/assets" +#map_doc_root = '{{ map_vector_path }}' +map_doc_root = '/library/www/map-vector' # 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_osm_vector_idx(installed_maps) + write_map_vector_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_osm_vector_idx(installed_maps): +def write_map_vector_idx(installed_maps): map_dict ={} idx_dict = {} for fname in installed_maps: @@ -125,7 +125,7 @@ def write_osm_vector_idx(installed_maps): idx_dict[item]['region'] = region idx_dict[item]['language'] = map_dict['perma_ref'][:2] - with open(osm_vector_idx_dir + '/osm_version_idx.json','w') as idx: + with open(map_vector_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/osm-vector/templates/index.html b/roles/map-vector/templates/index.html similarity index 94% rename from roles/osm-vector/templates/index.html rename to roles/map-vector/templates/index.html index ee7592eea..bef8adf46 100644 --- a/roles/osm-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/osm-vector/templates/main.js b/roles/map-vector/templates/main.js similarity index 100% rename from roles/osm-vector/templates/main.js rename to roles/map-vector/templates/main.js diff --git a/roles/osm-vector/templates/osm-vector.conf b/roles/map-vector/templates/osm-vector.conf similarity index 56% rename from roles/osm-vector/templates/osm-vector.conf rename to roles/map-vector/templates/osm-vector.conf index da390760f..e03739186 100644 --- a/roles/osm-vector/templates/osm-vector.conf +++ b/roles/map-vector/templates/osm-vector.conf @@ -1,7 +1,7 @@ # For downloadable regional vector tilesets -Alias /maps {{ osm_vector_path }} -Alias /osm-vector {{ osm_vector_path }} - +Alias /maps {{ map_vector_path }} +Alias /map-vector {{ map_vector_path }} + Options Indexes FollowSymLinks AllowOverride All Require all granted diff --git a/roles/osm-vector/files/test-index.redirect b/roles/osm-vector/files/test-index.redirect deleted file mode 100644 index bc2310bcc..000000000 --- a/roles/osm-vector/files/test-index.redirect +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/vars/default_vars.yml b/vars/default_vars.yml index a9d58fbf7..c1fc1881c 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 -osm_vector_install: True -osm_vector_enabled: True -osm_vector_path: '{{ content_base }}/www/osm-vector' +map_vector_install: True +map_vector_enabled: True +map_vector_path: '{{ content_base }}/www/map-vector' # 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 3ae4f871f..7830a81e7 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 -osm_vector_install: True -osm_vector_enabled: True +map_vector_install: True +map_vector_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 9449bedbc..943a12283 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 -osm_vector_install: True -osm_vector_enabled: True +map_vector_install: True +map_vector_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 0dff67b30..957f8cbe4 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 -osm_vector_install: True -osm_vector_enabled: True +map_vector_install: True +map_vector_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