You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer-guide/cli-methods/bundle-the-basemaps-assets-archive.md
+78-2Lines changed: 78 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,80 @@ Clone the [**linz/basemaps-config**][bm_config_repo] repository to your machine.
55
55
```bash
56
56
$BM_SPRITES_BIN = $BM_REPO/packages/sprites/bin
57
57
```
58
+
59
+
## Generate the `basemaps` assets
60
+
61
+
### 1. Create local directory
62
+
63
+
To prepare for bundling the `basemaps` assets archive, create a local directory on your machine with the following subdirectory structure:
64
+
65
+
```md
66
+
- assets
67
+
- fonts
68
+
- sprites
69
+
```
70
+
71
+
You can specify a location and directory name of your choice.
72
+
73
+
!!! abstract "Path"
74
+
75
+
On your machine, consider the following path:
76
+
77
+
=== "`ASSETS_DIR`"
78
+
79
+
The path to the created directory on your machine.
80
+
81
+
```bash
82
+
$ASSETS_DIR = {path_to_directory}
83
+
```
84
+
85
+
### 2. Convert fonts into `.pbf` (protobuf-encoded glyphs) files
86
+
87
+
To generate the `basemaps``.pbf` files, follow the instructions described in this [README.md][fonts_readme] file. Alternatively, there is a [repository][pbf_fonts_repo] containing various fonts that have already been converted into the `.pbf` format.
88
+
89
+
Move the generated and/or downloaded collections of `.pbf` files **into** the following directory:
90
+
91
+
```
92
+
$ASSETS_DIR/assets/fonts
93
+
```
94
+
95
+
The contents of your `$ASSETS_DIR/assets/fonts` directory should look similar to the following:
96
+
97
+
```md
98
+
- $ASSETS_DIR/assets/fonts
99
+
- Noto Sans Bold
100
+
- 0-255.pbf
101
+
- ...
102
+
- Open Sans Bold
103
+
- 0-255.pbf
104
+
- ...
105
+
```
106
+
107
+
### 3. Convert sprite files into sprite sheets
108
+
109
+
Use the following command to generate the `basemaps` sprite sheets from the collection of topographic sprite files:
110
+
111
+
```bash
112
+
node $BM_SPRITES_BIN/basemaps-sprites.mjs \
113
+
$BM_CONFIG_REPO/config/sprites/topographic
114
+
```
115
+
116
+
The above command will output the resulting sprite sheets to the location from which you executed the command. Move the outputted files **into** the following directory:
117
+
118
+
```md
119
+
$ASSETS_DIR/assets/sprites
120
+
```
121
+
122
+
The contents of your `$ASSETS_DIR/assets/sprites` directory should look similar to the following:
123
+
124
+
```md
125
+
- $ASSETS_DIR/assets/sprites
126
+
- topographic.json
127
+
- topographic.png
128
+
- topographic@2x.json
129
+
- topographic@2x.png
130
+
```
131
+
58
132
## Run the `basemaps/cli` package
59
133
60
134
### Command
@@ -63,15 +137,15 @@ Use the following command to bundle the `basemaps` assets archive:
63
137
64
138
```bash
65
139
node $BM_CLI_BUILD/bin.js bundle-assets \
66
-
--assets $BM_CONFIG_REPO/assets \
140
+
--assets $ASSETS_DIR \
67
141
--output assets.bundle.tar.co \
68
142
```
69
143
70
144
### Parameters
71
145
72
146
=== "`--assets`"
73
147
74
-
Specifies the location of the assets folder to use. This folder refers to that of which is within the `basemaps-config` repository.
148
+
Specifies the location of the assets folder to use. This folder refers to that which contains the `.pbf` files and sprite sheets on your local machine.
0 commit comments