@superrouteca/smap 1.0.1 → 1.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2 — 2026-10-27
4
+
5
+ - A layer takes a bare GeoJSON geometry as well (`addLines('route', { type: 'LineString', coordinates })`, a Polygon, a
6
+ Point, …): it is drawn as one feature. Before, such a layer stayed empty.
7
+
3
8
  ## 1.0.1 — 2026-10-27
4
9
 
5
10
  - Every map shows a small sMap badge (the sMap icon and name on a semi-transparent pill that reads on all five colour
package/README.md CHANGED
@@ -10,7 +10,7 @@ areas drawn on the GPU (hundreds of thousands of points, clustered or not), 3D b
10
10
  renew themselves. Also the JS client (no map view) for servers and workers: tokens, the nearest node, styles, tiles
11
11
  and raw reads.
12
12
 
13
- - Version 1.0.1, MIT licence (see `LICENSE` at the repository root)
13
+ - Version 1.0.2, MIT licence (see `LICENSE` at the repository root)
14
14
  - Works with bundlers (Vite, webpack, Next.js and others): ES module and CommonJS entry points with types
15
15
  - Nothing else to install: the map renderer is bundled in the package
16
16
  - Importing is safe on a server; a map is created in the browser only
package/dist/SOURCE.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
- "sdkVersion": "1.0.1",
2
+ "sdkVersion": "1.0.2",
3
3
  "engine": "maplibre-gl 6.16.0",
4
4
  "files": {
5
- "smap.js": "b48a84d65d3937c122f3f67b6cead8b9348913e2447782cca2a3f7a6c5d48ae7",
5
+ "smap.js": "37bf932e5eb0733a1ffa94acc6b2dfa74f1be61f2b5f23755ac128e6b791cabc",
6
6
  "smap.css": "558e15e5dfb3676e90f4cdfdb277c58f78c3d8de5527c8df1707f6c572241668",
7
- "smap-client.js": "8029946bec62ce4806e47e2324f3020b3d049b0a73bb98352cdd307474ae776c",
7
+ "smap-client.js": "98dcfa1dfcc526f3ef90b65808f8c4b7cdbf685bc300aaf89b2c831a0b9646d2",
8
8
  "smap-client.d.ts": "ad701612630a290b2dc0e49250ae25cea965ecb3a145c016bb462cd30f108cf7",
9
- "smap.mjs": "b59530982e07703ce3e3ffeaea328f18a86855e99076e737ee41c4dbd186104d",
10
- "smap.cjs": "22f7b7248f40d5436cb1cd4c865f06e1a38ab8f9beed96ec3828abf058549a71",
11
- "smap-client.cjs": "9956892bea8d367c1d278de11c3850293ad7d963d74d9692ce7194f6deff6f15",
12
- "smap-client.mjs": "176a70faf2b4ecb3f998e5823202097b2a9d1bce546c41f6411f2567e2f7e5ae",
9
+ "smap.mjs": "a87232f900f3720c344564cd99ee9c3dffab57439474bb9ddbd7a3759c14d730",
10
+ "smap.cjs": "b5fae0971013746dae97faade652b0dc22feaea923768b4ac812cab6a2e86ff5",
11
+ "smap-client.cjs": "7e911b6e17e24ae53ba5a8667ef19c8cde18796e6e51cea2fe65df1aab6b992e",
12
+ "smap-client.mjs": "479d2de9c90c8cbd9253297341cc5d51a12803d3de7bdfa99a753cdca696c0e1",
13
13
  "smap-client.d.cts": "80b96f5a907caf6295ca073816dc526e8d285f22670c809adaab5242a018e686",
14
14
  "smap-client.d.mts": "a66834cab868a6a0eaf943c1b185a236916cb00ecf32a871f972ab3213eddeba",
15
15
  "vendor-licenses.txt": "ee5fc05a0677eaf69601d2c7db0d9ecd6cc27c3abc1d0733bc9ed34707cf8ef2"
@@ -1,5 +1,5 @@
1
1
  /* Generated by js/build.mjs from js/src (see SOURCE.json). Do not edit. */
2
- /*! sMap JS client 1.0.1 — tokens, the nearest node, styles, tiles and raw reads, without a map view. */
2
+ /*! sMap JS client 1.0.2 — tokens, the nearest node, styles, tiles and raw reads, without a map view. */
3
3
  /*
4
4
  * Runs wherever `fetch` exists: browsers, Node.js 18+, workers; elsewhere (mini programs, older runtimes) pass your
5
5
  * own `fetch`. UMD: `window.SMapClient`, `require('smap-client')`, or an AMD module.
@@ -19,7 +19,7 @@
19
19
  }(typeof self !== 'undefined' ? self : this, function () {
20
20
  'use strict';
21
21
 
22
- var VERSION = '1.0.1';
22
+ var VERSION = '1.0.2';
23
23
  var NODE_TTL = 3600 * 1000; // the measured order
24
24
  var KNOWN_TTL = 30 * 86400 * 1000; // the last node list received, used when none can be read
25
25
 
@@ -1,4 +1,4 @@
1
- /*! sMap JS client 1.0.1 — tokens, the nearest node, styles, tiles and raw reads, without a map view. */
1
+ /*! sMap JS client 1.0.2 — tokens, the nearest node, styles, tiles and raw reads, without a map view. */
2
2
  /*
3
3
  * Runs wherever `fetch` exists: browsers, Node.js 18+, workers; elsewhere (mini programs, older runtimes) pass your
4
4
  * own `fetch`. UMD: `window.SMapClient`, `require('smap-client')`, or an AMD module.
@@ -18,7 +18,7 @@
18
18
  }(typeof self !== 'undefined' ? self : this, function () {
19
19
  'use strict';
20
20
 
21
- var VERSION = '1.0.1';
21
+ var VERSION = '1.0.2';
22
22
  var NODE_TTL = 3600 * 1000; // the measured order
23
23
  var KNOWN_TTL = 30 * 86400 * 1000; // the last node list received, used when none can be read
24
24
 
@@ -1,7 +1,7 @@
1
1
  /* Generated by js/build.mjs from js/src (see SOURCE.json). Do not edit. */
2
2
  var smapClientModule = { exports: {} };
3
3
  (function (module, exports, define) {
4
- /*! sMap JS client 1.0.1 — tokens, the nearest node, styles, tiles and raw reads, without a map view. */
4
+ /*! sMap JS client 1.0.2 — tokens, the nearest node, styles, tiles and raw reads, without a map view. */
5
5
  /*
6
6
  * Runs wherever `fetch` exists: browsers, Node.js 18+, workers; elsewhere (mini programs, older runtimes) pass your
7
7
  * own `fetch`. UMD: `window.SMapClient`, `require('smap-client')`, or an AMD module.
@@ -21,7 +21,7 @@ var smapClientModule = { exports: {} };
21
21
  }(typeof self !== 'undefined' ? self : this, function () {
22
22
  'use strict';
23
23
 
24
- var VERSION = '1.0.1';
24
+ var VERSION = '1.0.2';
25
25
  var NODE_TTL = 3600 * 1000; // the measured order
26
26
  var KNOWN_TTL = 30 * 86400 * 1000; // the last node list received, used when none can be read
27
27
 
package/dist/smap.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /* Generated by js/build.mjs from js/src (see SOURCE.json). Do not edit. */
2
2
  'use strict';
3
- /*! sMap Web SDK 1.0.1. Bundles maplibre-gl 6.16.0 (BSD-3-Clause), see vendor-licenses.txt. */
3
+ /*! sMap Web SDK 1.0.2. Bundles maplibre-gl 6.16.0 (BSD-3-Clause), see vendor-licenses.txt. */
4
4
 
5
5
  var smapCore = null;
6
6
  function smapCreateEngine() {
@@ -26872,7 +26872,7 @@ function smapCreateSdk(engine) {
26872
26872
  })(typeof self !== 'undefined' ? self : this, function (engine) {
26873
26873
  'use strict';
26874
26874
 
26875
- var VERSION = '1.0.1';
26875
+ var VERSION = '1.0.2';
26876
26876
  var FLAVORS = ['light', 'white', 'grayscale', 'dark', 'black'];
26877
26877
  var BASEMAP_SOURCE = 'basemap';
26878
26878
  var BUILDINGS_LAYER = 'smap-buildings-3d';
@@ -26888,10 +26888,16 @@ function smapCreateSdk(engine) {
26888
26888
  } catch (e) { return 0; }
26889
26889
  }
26890
26890
 
26891
+ var GEOMETRY_TYPES = ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon', 'GeometryCollection'];
26892
+
26891
26893
  function toFeatureCollection(data) {
26892
26894
  if (!data) { return { type: 'FeatureCollection', features: [] }; }
26893
26895
  if (data.type === 'FeatureCollection') { return data; }
26894
26896
  if (data.type === 'Feature') { return { type: 'FeatureCollection', features: [data] }; }
26897
+ // A bare geometry (a LineString from a directions answer, a Polygon, …) is GeoJSON too: one feature without properties.
26898
+ if (GEOMETRY_TYPES.indexOf(data.type) !== -1) {
26899
+ return { type: 'FeatureCollection', features: [{ type: 'Feature', properties: {}, geometry: data }] };
26900
+ }
26895
26901
  if (Array.isArray(data)) {
26896
26902
  var features = new Array(data.length);
26897
26903
  for (var i = 0; i < data.length; i++) {
@@ -27466,7 +27472,7 @@ function SMapMap(options) {
27466
27472
  SMapMap.prototype = core.Map.prototype;
27467
27473
  return new core.Map(options);
27468
27474
  }
27469
- var smapVersion = "1.0.1";
27475
+ var smapVersion = "1.0.2";
27470
27476
  var smapStyles = ['light', 'white', 'grayscale', 'dark', 'black'];
27471
27477
  /** The bundled rendering engine, for anything the SDK does not wrap (loaded on the first call). */
27472
27478
  function smapGetEngine() { return smapLoad().engine; }
package/dist/smap.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! sMap Web SDK 1.0.1. Bundles maplibre-gl 6.16.0 (BSD-3-Clause), see vendor-licenses.txt. */
1
+ /*! sMap Web SDK 1.0.2. Bundles maplibre-gl 6.16.0 (BSD-3-Clause), see vendor-licenses.txt. */
2
2
  (function () {
3
3
  function smapCreateEngine() {
4
4
  var smapEngineExports = (() => {
@@ -26869,7 +26869,7 @@ function smapCreateSdk(engine) {
26869
26869
  })(typeof self !== 'undefined' ? self : this, function (engine) {
26870
26870
  'use strict';
26871
26871
 
26872
- var VERSION = '1.0.1';
26872
+ var VERSION = '1.0.2';
26873
26873
  var FLAVORS = ['light', 'white', 'grayscale', 'dark', 'black'];
26874
26874
  var BASEMAP_SOURCE = 'basemap';
26875
26875
  var BUILDINGS_LAYER = 'smap-buildings-3d';
@@ -26885,10 +26885,16 @@ function smapCreateSdk(engine) {
26885
26885
  } catch (e) { return 0; }
26886
26886
  }
26887
26887
 
26888
+ var GEOMETRY_TYPES = ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon', 'GeometryCollection'];
26889
+
26888
26890
  function toFeatureCollection(data) {
26889
26891
  if (!data) { return { type: 'FeatureCollection', features: [] }; }
26890
26892
  if (data.type === 'FeatureCollection') { return data; }
26891
26893
  if (data.type === 'Feature') { return { type: 'FeatureCollection', features: [data] }; }
26894
+ // A bare geometry (a LineString from a directions answer, a Polygon, …) is GeoJSON too: one feature without properties.
26895
+ if (GEOMETRY_TYPES.indexOf(data.type) !== -1) {
26896
+ return { type: 'FeatureCollection', features: [{ type: 'Feature', properties: {}, geometry: data }] };
26897
+ }
26892
26898
  if (Array.isArray(data)) {
26893
26899
  var features = new Array(data.length);
26894
26900
  for (var i = 0; i < data.length; i++) {
package/dist/smap.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /* Generated by js/build.mjs from js/src (see SOURCE.json). Do not edit. */
2
- /*! sMap Web SDK 1.0.1. Bundles maplibre-gl 6.16.0 (BSD-3-Clause), see vendor-licenses.txt. */
2
+ /*! sMap Web SDK 1.0.2. Bundles maplibre-gl 6.16.0 (BSD-3-Clause), see vendor-licenses.txt. */
3
3
 
4
4
  var smapCore = null;
5
5
  function smapCreateEngine() {
@@ -26871,7 +26871,7 @@ function smapCreateSdk(engine) {
26871
26871
  })(typeof self !== 'undefined' ? self : this, function (engine) {
26872
26872
  'use strict';
26873
26873
 
26874
- var VERSION = '1.0.1';
26874
+ var VERSION = '1.0.2';
26875
26875
  var FLAVORS = ['light', 'white', 'grayscale', 'dark', 'black'];
26876
26876
  var BASEMAP_SOURCE = 'basemap';
26877
26877
  var BUILDINGS_LAYER = 'smap-buildings-3d';
@@ -26887,10 +26887,16 @@ function smapCreateSdk(engine) {
26887
26887
  } catch (e) { return 0; }
26888
26888
  }
26889
26889
 
26890
+ var GEOMETRY_TYPES = ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon', 'GeometryCollection'];
26891
+
26890
26892
  function toFeatureCollection(data) {
26891
26893
  if (!data) { return { type: 'FeatureCollection', features: [] }; }
26892
26894
  if (data.type === 'FeatureCollection') { return data; }
26893
26895
  if (data.type === 'Feature') { return { type: 'FeatureCollection', features: [data] }; }
26896
+ // A bare geometry (a LineString from a directions answer, a Polygon, …) is GeoJSON too: one feature without properties.
26897
+ if (GEOMETRY_TYPES.indexOf(data.type) !== -1) {
26898
+ return { type: 'FeatureCollection', features: [{ type: 'Feature', properties: {}, geometry: data }] };
26899
+ }
26894
26900
  if (Array.isArray(data)) {
26895
26901
  var features = new Array(data.length);
26896
26902
  for (var i = 0; i < data.length; i++) {
@@ -27465,7 +27471,7 @@ function SMapMap(options) {
27465
27471
  SMapMap.prototype = core.Map.prototype;
27466
27472
  return new core.Map(options);
27467
27473
  }
27468
- var smapVersion = "1.0.1";
27474
+ var smapVersion = "1.0.2";
27469
27475
  var smapStyles = ['light', 'white', 'grayscale', 'dark', 'black'];
27470
27476
  /** The bundled rendering engine, for anything the SDK does not wrap (loaded on the first call). */
27471
27477
  function smapGetEngine() { return smapLoad().engine; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superrouteca/smap",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "sMap for the web: maps from Superroute's sMap service, the Web SDK (map view) and the JS client (tokens, nearest node, styles, tiles).",
5
5
  "license": "MIT",
6
6
  "author": "Goodneo Solutions",