@tomtom-org/maps-sdk-plugin-landmarks-3d 0.0.13 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/bundledTranscoder-IHtuhlDT.js +1 -0
- package/dist/index.d.ts +134 -57
- package/dist/index.es.js +1 -1
- package/package.json +4 -3
- package/dist/bundledTranscoder-Dn27cuYm.js +0 -1
package/README.md
CHANGED
|
@@ -12,9 +12,8 @@ This plugin for the [TomTom Maps SDK for JavaScript](https://docs.tomtom.com/map
|
|
|
12
12
|
## Features
|
|
13
13
|
|
|
14
14
|
- Streams 3D landmark tiles for the current viewport.
|
|
15
|
-
- Shows the basemap 3D building layer (hidden by default in the standard styles) for full 3D city context.
|
|
16
15
|
- Hides basemap extruded buildings flagged with `has_landmark` so they don't clip through the landmark meshes.
|
|
17
|
-
-
|
|
16
|
+
- Shades the landmarks like the base map's 3D buildings, and follows whatever restyles them, such as the map colours. Set a knob, such as `color` or `opacity`, for a look of your own.
|
|
18
17
|
- Restores itself automatically across map style changes.
|
|
19
18
|
|
|
20
19
|
## Quickstart
|
|
@@ -25,24 +24,27 @@ This plugin declares `@tomtom-org/maps-sdk`, `maplibre-gl` and `three` as peer d
|
|
|
25
24
|
npm install @tomtom-org/maps-sdk maplibre-gl three @tomtom-org/maps-sdk-plugin-landmarks-3d
|
|
26
25
|
```
|
|
27
26
|
|
|
28
|
-
1. Follow the SDK [Project setup](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup) or the Map [quickstart](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart) to create and initialize a `TomTomMap`. For the best result, use a pitched camera.
|
|
27
|
+
1. Follow the SDK [Project setup](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup) or the Map [quickstart](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart) to create and initialize a `TomTomMap`. For the best result, use a pitched camera.
|
|
29
28
|
|
|
30
29
|
2. Import and use the plugin (plugin-specific steps only):
|
|
31
30
|
|
|
32
31
|
```ts
|
|
32
|
+
import { BaseMapModule } from '@tomtom-org/maps-sdk/map';
|
|
33
33
|
import { Landmarks3D } from '@tomtom-org/maps-sdk-plugin-landmarks-3d';
|
|
34
34
|
|
|
35
35
|
// assume `map` is your initialized TomTomMap instance
|
|
36
|
+
// the 3D city around the landmarks, hidden in most standard styles
|
|
37
|
+
await BaseMapModule.get(map, { groups: { buildings3D: { visible: true } } });
|
|
36
38
|
const landmarks = new Landmarks3D(map);
|
|
37
39
|
|
|
38
|
-
// optional:
|
|
39
|
-
|
|
40
|
+
// optional: a colour of your own, while the other knobs keep following the base map
|
|
41
|
+
landmarks.updateConfig({ color: '#c8b28a' });
|
|
40
42
|
|
|
41
43
|
// optional: hide them, and bring them back with setVisible(true)
|
|
42
|
-
|
|
44
|
+
landmarks.setVisible(false);
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
`new Landmarks3D(map, {
|
|
47
|
+
`new Landmarks3D(map, { color, opacity, verticalGradient, visible, minZoom, maxZoom })` sets the same knobs up front. Each one you leave out follows the base map's 3D buildings, zoom range included.
|
|
46
48
|
|
|
47
49
|
## License
|
|
48
50
|
|