@sigma/layer-maplibre 3.0.0-beta.6 → 3.0.0-beta.8

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.
@@ -142,15 +142,19 @@ function bindMaplibreLayer(sigma, opts) {
142
142
  var prevSigmaSettings = sigma.getSettings();
143
143
 
144
144
  // Creating map container
145
- var mapContainer = document.createElement("div");
146
- var mapContainerId = "".concat(sigma.getContainer().id, "-map");
147
- mapContainer.setAttribute("id", mapContainerId);
148
- mapContainer.setAttribute("style", "position: absolute; inset: 0");
145
+ var mapContainer = sigma.createLayer("layer-leaflet", "div", {
146
+ style: {
147
+ position: "absolute",
148
+ inset: "0"
149
+ },
150
+ // 'edges' is the first sigma layer
151
+ beforeLayer: "edges"
152
+ });
149
153
  sigma.getContainer().prepend(mapContainer);
150
154
 
151
155
  // Initialize the map
152
156
  var map = new maplibreGl.Map(_objectSpread2({
153
- container: mapContainerId,
157
+ container: mapContainer,
154
158
  style: "https://demotiles.maplibre.org/style.json",
155
159
  center: [0, 0],
156
160
  zoom: 1,
@@ -142,15 +142,19 @@ function bindMaplibreLayer(sigma, opts) {
142
142
  var prevSigmaSettings = sigma.getSettings();
143
143
 
144
144
  // Creating map container
145
- var mapContainer = document.createElement("div");
146
- var mapContainerId = "".concat(sigma.getContainer().id, "-map");
147
- mapContainer.setAttribute("id", mapContainerId);
148
- mapContainer.setAttribute("style", "position: absolute; inset: 0");
145
+ var mapContainer = sigma.createLayer("layer-leaflet", "div", {
146
+ style: {
147
+ position: "absolute",
148
+ inset: "0"
149
+ },
150
+ // 'edges' is the first sigma layer
151
+ beforeLayer: "edges"
152
+ });
149
153
  sigma.getContainer().prepend(mapContainer);
150
154
 
151
155
  // Initialize the map
152
156
  var map = new maplibreGl.Map(_objectSpread2({
153
- container: mapContainerId,
157
+ container: mapContainer,
154
158
  style: "https://demotiles.maplibre.org/style.json",
155
159
  center: [0, 0],
156
160
  zoom: 1,
@@ -138,15 +138,19 @@ function bindMaplibreLayer(sigma, opts) {
138
138
  var prevSigmaSettings = sigma.getSettings();
139
139
 
140
140
  // Creating map container
141
- var mapContainer = document.createElement("div");
142
- var mapContainerId = "".concat(sigma.getContainer().id, "-map");
143
- mapContainer.setAttribute("id", mapContainerId);
144
- mapContainer.setAttribute("style", "position: absolute; inset: 0");
141
+ var mapContainer = sigma.createLayer("layer-leaflet", "div", {
142
+ style: {
143
+ position: "absolute",
144
+ inset: "0"
145
+ },
146
+ // 'edges' is the first sigma layer
147
+ beforeLayer: "edges"
148
+ });
145
149
  sigma.getContainer().prepend(mapContainer);
146
150
 
147
151
  // Initialize the map
148
152
  var map = new Map(_objectSpread2({
149
- container: mapContainerId,
153
+ container: mapContainer,
150
154
  style: "https://demotiles.maplibre.org/style.json",
151
155
  center: [0, 0],
152
156
  zoom: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigma/layer-maplibre",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0-beta.8",
4
4
  "description": "A plugin to set a geographical map in background",
5
5
  "main": "dist/sigma-layer-maplibre.cjs.js",
6
6
  "module": "dist/sigma-layer-maplibre.esm.js",
@@ -45,5 +45,5 @@
45
45
  },
46
46
  "./package.json": "./package.json"
47
47
  },
48
- "gitHead": "16ff5c7c421ea2f1a89e52cb694cf7c21892d653"
48
+ "gitHead": "8edd2ee8dad222bac99439feed321d55896bb61e"
49
49
  }