Skip to content

Bundle the basemaps config file

This guide explains how to generate the basemaps bundled config file using the basemaps/cli package.

Prerequisites

Imagery

You'll need AWS credentials with permission to read files from the LINZ AWS S3 bucket at s3://linz-basemaps. Such credentials are required to access LINZ's imagery when bundling the config file.

Get started

Clone the linz/basemaps-config repository to your machine.

git clone https://github.com/linz/basemaps-config.git
git clone git@github.com:linz/basemaps-config.git
gh repo clone linz/basemaps-config

Paths

This guide uses variables as shorthand to reference key directories and files. On your machine, note the following paths:

The path to the basemaps-config repository folder on your machine.

$BM_CONFIG_REPO = {path_to}/basemaps-config

The basemaps/cli package provides a bundle function we can use to generate a bundled config file.

The path to the build folder of the basemaps/cli package.

$BM_CLI_BUILD = $BM_REPO/packages/cli/build/cli

Run the basemaps/cli package

Command

Use the following command to bundle the basemaps config file:

node $BM_CLI_BUILD/bin.js bundle \
    --config $BM_CONFIG_REPO/config \
    --output config.bundle.json \
    --cache s3://linz-basemaps-staging/basemaps-config/cache/

Parameters

Specifies the location of the config folder to use. This folder refers to that of which is within the basemaps-config repository.

Specifies where to save the bundled config file, relative to the location from which you execute the command. You can specify a location and filename of your choice.

Specifies the location of the cache directory. This parameter is optional but recommended to reduce the time needed to construct the config file.