Accessing map.apps source maps

When developing a project with map.apps for Developers it is often useful to have access to the source code of all bundles while debugging the application. When you set up the project as described in Getting Started, the map.apps source code is made available as source maps when debugging the app in a browser.

But when map.apps for Developers runs in remote project mode, you need to activate source map support in the remote map.apps instance to get access to them.

Checklist

To follow this guide, you need:
  • map.apps for Developers set up to run in remote project mode. Check Using remote project mode if unsure.

  • Access to the remote map.apps instance’s configuration

Step 1: Enable source map support

Source maps should only be enabled for stage or development map.apps instances for security reasons, as it will reveal the map.apps code to the client.

Source map support must be configured in the remote map.apps instance usually set as mapapps.remote.base in the pom.xml of map.apps for Developers.

  1. Open the application.properties of the remote map.apps instance.

  2. Set the property

    # .mapapps/application.properties
    jsregistry.sourcemaps.enabled=true
  3. Restart map.apps.

Step 2: Access the source maps

  1. Open your map.app for Developers in Google Chrome, http://localhost:9090, for example

  2. Wait for the app to load completely

  3. Open the Chrome DevTools by pressing Ctrl+Shift+I

  4. In the DevTools, select the Sources press Ctrl+P to open the file search.

  5. Search for the source file of a map.apps bundle and open the file, for example MapWidget.ts.

  6. The content of the file is provided by the remote map.apps instance based on source maps.

You can now set breakpoints and inspect the source code of bundles delivered by map.apps.

map.apps can only deliver source maps for those bundles that contain source map files in their bundle folder when deployed to map.apps.

sourcemaps debug 01
Debugging map.apps source code in map.apps for Developers