@maptiler/sdk 3.1.1 → 3.2.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 CHANGED
@@ -40,30 +40,30 @@ In addition to the details and examples provided in this readme, check out the [
40
40
  **Recommended for:** advanced applications
41
41
 
42
42
  ```ts
43
- import * as maptilersdk from '@maptiler/sdk';
43
+ import { config, Map } from '@maptiler/sdk';
44
44
 
45
45
  // Add your MapTiler Cloud API key to the config
46
46
  // (Go to https://cloud.maptiler.com/account/keys/ to get one for free!)
47
- maptilersdk.config.apiKey = 'YOUR_API_KEY';
47
+ config.apiKey = 'YOUR_API_KEY';
48
48
 
49
49
  // Let's say you have a DIV ready to receive a map
50
50
  const mapContainer = document.getElementById('my-container-div');
51
51
 
52
52
  // Instantiate the map
53
- const map = new maptilersdk.Map({
53
+ const map = new Map({
54
54
  container: mapContainer,
55
55
  });
56
56
  ```
57
57
 
58
58
  Alternatively, the `apiKey` can be set as Map option instead of in the `config` object. Yet, this will still internally propagate to the `config` object:
59
59
  ```ts
60
- import * as maptilersdk from '@maptiler/sdk';
60
+ import { Map } from '@maptiler/sdk';
61
61
 
62
62
  // Let's say you have a DIV ready to receive a map
63
63
  const mapContainer = document.getElementById('my-container-div');
64
64
 
65
65
  // Instantiate the map
66
- const map = new maptilersdk.Map({
66
+ const map = new Map({
67
67
  container: mapContainer,
68
68
  apiKey: 'YOUR_API_KEY'
69
69
  });