mapicgc-gl-js 0.0.76 → 0.0.77

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
@@ -47,14 +47,22 @@ Check out the features through <a href="https://codepen.io/collection/mrvVZd" ta
47
47
  2. Import the library:
48
48
  ```html
49
49
  <script>
50
- import { Map,Styles } from 'mapicgc-gl-js';
51
-
52
- const map = Map({
53
- container: 'map',
54
- style: Styles.LIGHT,
55
- center: [2.1464, 41.306],
56
- zoom: 7.4,
57
- });
50
+ import { Map, Config } from "mapicgc-gl-js";
51
+ //import * as mapicgcgl from "mapicgc-gl-js";
52
+
53
+ async function initMap() {
54
+ const data = await Config.getConfigICGC(); //load config
55
+ const map = new Map({
56
+ container: "map",
57
+ style: data.Styles.LIGHT,
58
+ center: [1.808, 41.618],
59
+ zoom: 10,
60
+ maxZoom: 19,
61
+ hash: true,
62
+ pitch: 0,
63
+ });
64
+ }
65
+ initMap();
58
66
  </script>
59
67
  ```
60
68
  ### CDN
@@ -70,12 +78,17 @@ Check out the features through <a href="https://codepen.io/collection/mrvVZd" ta
70
78
  ```html
71
79
  <div id="map"></div>
72
80
  <script>
73
- const map = mapicgcgl.Map({
74
- container: 'map',
75
- style: mapicgcgl.Styles.LIGHT,
76
- center: [2.1464, 41.306],
77
- zoom: 7.4,
78
- });
81
+ async function initMap() {
82
+ const data = await mapicgcgl.Config.getConfigICGC();
83
+ const map = new mapicgcgl.Map({
84
+ container: "map",
85
+ style: data.Styles.TOPO, // <-- add style basemap here
86
+ center: [2.1464, 41.306],
87
+ zoom: 7.4,
88
+ maxZoom: 19,
89
+ hash: true,
90
+ pitch: 0,
91
+ });
79
92
  </script>
80
93
  ```
81
94