radar-sdk-js 4.4.5 → 4.4.6-beta.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 +7 -7
- package/dist/radar.js +12 -2
- package/dist/radar.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/ui/RadarMap.ts +12 -1
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
|
|
|
56
56
|
|
|
57
57
|
Add the following script in your `html` file
|
|
58
58
|
```html
|
|
59
|
-
<script src="https://js.radar.com/v4.4.
|
|
59
|
+
<script src="https://js.radar.com/v4.4.6-beta.0/radar.min.js"></script>
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Then initialize the Radar SDK
|
|
@@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
|
|
|
73
73
|
```html
|
|
74
74
|
<html>
|
|
75
75
|
<head>
|
|
76
|
-
<link href="https://js.radar.com/v4.4.
|
|
77
|
-
<script src="https://js.radar.com/v4.4.
|
|
76
|
+
<link href="https://js.radar.com/v4.4.6-beta.0/radar.css" rel="stylesheet">
|
|
77
|
+
<script src="https://js.radar.com/v4.4.6-beta.0/radar.min.js"></script>
|
|
78
78
|
</head>
|
|
79
79
|
|
|
80
80
|
<body>
|
|
@@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
|
|
|
98
98
|
```html
|
|
99
99
|
<html>
|
|
100
100
|
<head>
|
|
101
|
-
<link href="https://js.radar.com/v4.4.
|
|
102
|
-
<script src="https://js.radar.com/v4.4.
|
|
101
|
+
<link href="https://js.radar.com/v4.4.6-beta.0/radar.css" rel="stylesheet">
|
|
102
|
+
<script src="https://js.radar.com/v4.4.6-beta.0/radar.min.js"></script>
|
|
103
103
|
</head>
|
|
104
104
|
|
|
105
105
|
<body>
|
|
@@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
|
|
|
130
130
|
```html
|
|
131
131
|
<html>
|
|
132
132
|
<head>
|
|
133
|
-
<link href="https://js.radar.com/v4.4.
|
|
134
|
-
<script src="https://js.radar.com/v4.4.
|
|
133
|
+
<link href="https://js.radar.com/v4.4.6-beta.0/radar.css" rel="stylesheet">
|
|
134
|
+
<script src="https://js.radar.com/v4.4.6-beta.0/radar.min.js"></script>
|
|
135
135
|
</head>
|
|
136
136
|
|
|
137
137
|
<body>
|
package/dist/radar.js
CHANGED
|
@@ -405,7 +405,7 @@ class Navigator {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
var SDK_VERSION = '4.4.
|
|
408
|
+
var SDK_VERSION = '4.4.6-beta.0';
|
|
409
409
|
|
|
410
410
|
const inFlightRequests = new Map();
|
|
411
411
|
class Http {
|
|
@@ -2016,6 +2016,16 @@ const getStyle = (options, mapOptions) => {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
return mapOptions.style; // style object or URL
|
|
2018
2018
|
};
|
|
2019
|
+
const logMapOptions = (options, mapOptions) => {
|
|
2020
|
+
if (options.debug) {
|
|
2021
|
+
const optionsCopy = structuredClone(mapOptions);
|
|
2022
|
+
if (typeof (optionsCopy === null || optionsCopy === void 0 ? void 0 : optionsCopy.container) !== 'string') {
|
|
2023
|
+
// BUGFIX: remove circular references when using react ref as container
|
|
2024
|
+
delete optionsCopy.container;
|
|
2025
|
+
}
|
|
2026
|
+
Logger.debug(`initialize map with options: ${JSON.stringify(optionsCopy)}`);
|
|
2027
|
+
}
|
|
2028
|
+
};
|
|
2019
2029
|
class RadarMap extends maplibregl.Map {
|
|
2020
2030
|
constructor(radarMapOptions) {
|
|
2021
2031
|
const config = Config.get();
|
|
@@ -2025,7 +2035,7 @@ class RadarMap extends maplibregl.Map {
|
|
|
2025
2035
|
// configure map options
|
|
2026
2036
|
const style = getStyle(config, radarMapOptions);
|
|
2027
2037
|
const mapOptions = Object.assign({}, defaultRadarMapOptions, defaultMaplibreOptions, radarMapOptions, { style });
|
|
2028
|
-
|
|
2038
|
+
logMapOptions(config, mapOptions);
|
|
2029
2039
|
mapOptions.transformRequest = (url, resourceType) => {
|
|
2030
2040
|
// this handles when a style is switched
|
|
2031
2041
|
if (resourceType === 'Style' && isRadarStyle(url)) {
|
package/dist/radar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.4.
|
|
1
|
+
declare const _default: "4.4.6-beta.0";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
package/src/ui/RadarMap.ts
CHANGED
|
@@ -77,6 +77,17 @@ const getStyle = (options: RadarOptions, mapOptions: RadarMapOptions) => {
|
|
|
77
77
|
return mapOptions.style; // style object or URL
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
const logMapOptions = (options: RadarOptions, mapOptions: RadarMapOptions) => {
|
|
81
|
+
if (options.debug) {
|
|
82
|
+
const optionsCopy: any = structuredClone(mapOptions);
|
|
83
|
+
if (typeof optionsCopy?.container !== 'string') {
|
|
84
|
+
// BUGFIX: remove circular references when using react ref as container
|
|
85
|
+
delete optionsCopy.container;
|
|
86
|
+
}
|
|
87
|
+
Logger.debug(`initialize map with options: ${JSON.stringify(optionsCopy)}`);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
80
91
|
class RadarMap extends maplibregl.Map {
|
|
81
92
|
_markers: RadarMarker[] = [];
|
|
82
93
|
_features: RadarMapFeature[] = [];
|
|
@@ -96,7 +107,7 @@ class RadarMap extends maplibregl.Map {
|
|
|
96
107
|
radarMapOptions,
|
|
97
108
|
{ style },
|
|
98
109
|
);
|
|
99
|
-
|
|
110
|
+
logMapOptions(config, mapOptions);
|
|
100
111
|
|
|
101
112
|
(mapOptions as maplibregl.MapOptions).transformRequest = (url, resourceType) => {
|
|
102
113
|
// this handles when a style is switched
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '4.4.
|
|
1
|
+
export default '4.4.6-beta.0';
|