diff --git a/roles/osm-vector-maps/tasks/main.yml b/roles/osm-vector-maps/tasks/main.yml index 9cccd6aa0..bf7a7bbf1 100644 --- a/roles/osm-vector-maps/tasks/main.yml +++ b/roles/osm-vector-maps/tasks/main.yml @@ -39,7 +39,7 @@ name: python-geojson state: present -- name: Install /usr/bin/iiab-update-map for updating of Map Pack catalog +- name: Install /usr/bin/iiab-update-map for updating of Map Pack catalog & descriptions template: src: iiab-update-map dest: /usr/bin/iiab-update-map diff --git a/roles/osm-vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map index b11dcba90..ee56b142a 100755 --- a/roles/osm-vector-maps/templates/iiab-update-map +++ b/roles/osm-vector-maps/templates/iiab-update-map @@ -27,8 +27,7 @@ else: doc_root = get_iiab_env('WWWROOT') menuDefs = doc_root + "/js-menu/menu-files/menu-defs/" vector_map_idx_dir = doc_root + "/common/assets" -#map_doc_root = '{{ vector_map_path }}' -map_doc_root = '/library/www/osm-vector-maps' +map_doc_root = '{{ vector_map_path }}' # /library/www/osm-vector-maps # map_catalog will be global, assumed always available map_catalog = {} map_menu_def_list = [] @@ -75,10 +74,10 @@ def main(): fetch_menu_json_value('autoupdate_menu'),region,)) menus.update_menu_json(menu_ref) # redirect from box/maps to an installed map rather than test page - with open('{{ vector_map_path }}/index.html','w') as fp: + with open(map_doc_root + '/index.html','w') as fp: outstr = """ \n\n"""%fname fp.write(outstr) - + def get_map_catalog(): global map_catalog @@ -165,11 +164,24 @@ def create_menu_def(region,default_name,intended_use='map'): menuDef["logo_url"] = default_logo menuitem = lang + '-' + item['perma_ref'] menuDef["menu_item_name"] = default_name - menuDef["title"] = "OpenStreetMap: 18 Levels of Zoom for " + item.get('title','ERROR') + '' + + if item.get('title','ERROR') == "World": + fancyTitle = "Planet Earth" + elif item.get('title','ERROR') == "Central America": + fancyTitle = "Central America-Caribbean" + else: + fancyTitle = item.get('title','ERROR') + + if fancyTitle == "Planet Earth": + menuDef["title"] = "OpenStreetMap: " + fancyTitle + else: + menuDef["title"] = "OpenStreetMap: " + fancyTitle + " & Earth" + menuDef["map_name"] = item['perma_ref'] # the following is in the idx json #menuDef["file_name"] = lang + '-osm-omt_' + region + '_' + os.path.basename(item['url'])[:-4] - menuDef["description"] = '

Resolution of the Whole World to 5 KM. OpenStreetMap data for ' + item.get('title','') + ' with details down to 5 Meters

' + menuDef["description"] = '18 levels of zoom (~1 m details) for ' + fancyTitle + ', illustrating human geography.

10 levels of zoom (~1 km details) for satellite photos, covering the whole world.' + menuDef["extra_description"] = 'Search for cities/towns with more than 1000 people. There are about 127,654 worldwide.' menuDef["extra_html"] = "" #menuDef["automatically_generated"] = "true" menuDef["change_ref"] = "generated" @@ -177,7 +189,7 @@ def create_menu_def(region,default_name,intended_use='map'): if not os.path.isfile(menuDefs + default_name): # logic to here can still overwrite existing menu def print("creating %s"%menuDefs + default_name) with open(menuDefs + default_name,'w') as menufile: - menufile.write(json.dumps(menuDef,indent=2)) + menufile.write(json.dumps(menuDef,indent=4)) return default_name[:-5] def human_readable(num):