Uploaded image for project: 'ActivityInfo'
  1. AI-1530

Administrative level maps are broken on website

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - time allowing
    • Resolution: Fixed
    • Fix Version/s: 2.13.1024
    • Component/s: Website
    • Labels:
      None

      Description

      It is possible to browse through the administrative levels in our geodatabase on the ActivityInfo website. For example, governorates in Yemen. Currently these pages show an empty space where a with the polygons map should be displayed:

      This should instead look like:

      The background of this issue is that the application used to serve map tiles through the API, but this feature has been removed in July 2014.

      Proposed solution: instead of using our own tiles, we can use our Mapbox service to display the map and to overlay the polygons with the administrative levels. We need to add the following to AdminLevel.ftl

      <!-- load CSS (store on server if necessary) -->
      <link href='https://api.mapbox.com/mapbox.js/v3.0.1/mapbox.css' rel='stylesheet' />
      
      <!-- load mapbox.js (store on server if necessary) -->
      <script src='https://api.mapbox.com/mapbox.js/v3.0.1/mapbox.js'></script>
      
      <!-- add script to end of template -->
      <script type="application/javascript">
          L.mapbox.accessToken = 'pk.eyJ1IjoiYWN0aXZpdHlpbmZvIiwiYSI6Ik5xVDlfRkkifQ.47_5IbyfXQWGWqxpCI80AQ';
          var map = L.mapbox.map('map').setView([${country.bounds.centerLat?c}, ${country.bounds.centerLon?c}], 6);
          L.mapbox.styleLayer('mapbox://styles/mapbox/light-v9').addTo(map);
          var featureLayer = L.mapbox.featureLayer()
              .loadURL('/resources/adminLevel/${id?c}/entities/features')
              .addTo(map);
      </script>
      

      This loads the GeoJSON data from the API and adds the polygons as a layer on top of the map.

        TestRail: Results

          Attachments

            Activity

              People

              • Assignee:
                alex Alexander Bertram
                Reporter:
                mj Maarten-Jan Kallen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  TestRail: Cases