New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

radar-sdk-js

Package Overview
Dependencies
Maintainers
6
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

radar-sdk-js - npm Package Compare versions

Comparing version 4.3.0-beta.8 to 4.3.0-beta.9

18

dist/types.d.ts

@@ -350,16 +350,20 @@ export type LogLevel = 'none' | 'info' | 'warn' | 'error';

}
export interface RadarMarkerImage {
url?: string;
radarMarkerId?: string;
width?: number;
height?: number;
}
export interface RadarMarkerPopupOptions extends maplibregl.PopupOptions {
text?: string;
html?: string;
element?: HTMLElement;
}
export interface RadarMarkerOptions extends maplibregl.MarkerOptions {
/**
* @deprecated Use popup.text
*/
text?: string;
/**
* @deprecated Use popup.html
*/
html?: string;
image?: RadarMarkerImage;
url?: string;
marker?: string;
width?: number;
height?: number;
popup?: RadarMarkerPopupOptions;

@@ -366,0 +370,0 @@ }

import maplibregl from 'maplibre-gl';
import type RadarMap from './RadarMap';
import type { RadarMarkerImage, RadarMarkerOptions } from '../types';
import type { RadarMarkerOptions } from '../types';
declare class RadarMarker extends maplibregl.Marker {
_map: RadarMap;
_image?: RadarMarkerImage;
constructor(markerOptions: RadarMarkerOptions);

@@ -8,0 +7,0 @@ addTo(map: RadarMap): this;

@@ -1,2 +0,2 @@

declare const _default: "4.3.0-beta.8";
declare const _default: "4.3.0-beta.9";
export default _default;
{
"name": "radar-sdk-js",
"version": "4.3.0-beta.8",
"version": "4.3.0-beta.9",
"description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.",

@@ -55,4 +55,4 @@ "homepage": "https://radar.com",

"peerDependencies": {
"maplibre-gl": "^2.4.0 || ^3.0.0"
"maplibre-gl": "^2.4.0 || ^3.0.0 || ^4.0.0"
}
}

@@ -59,3 +59,3 @@ <p align="center">

```html
<script src="https://js.radar.com/v4.3.0-beta.8/radar.min.js"></script>
<script src="https://js.radar.com/v4.3.0-beta.9/radar.min.js"></script>
```

@@ -77,4 +77,4 @@

<head>
<link href="https://js.radar.com/v4.3.0-beta.8/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.3.0-beta.8/radar.min.js"></script>
<link href="https://js.radar.com/v4.3.0-beta.9/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.3.0-beta.9/radar.min.js"></script>
</head>

@@ -103,4 +103,4 @@

<head>
<link href="https://js.radar.com/v4.3.0-beta.8/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.3.0-beta.8/radar.min.js"></script>
<link href="https://js.radar.com/v4.3.0-beta.9/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.3.0-beta.9/radar.min.js"></script>
</head>

@@ -136,4 +136,4 @@

<head>
<link href="https://js.radar.com/v4.3.0-beta.8/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.3.0-beta.8/radar.min.js"></script>
<link href="https://js.radar.com/v4.3.0-beta.9/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.3.0-beta.9/radar.min.js"></script>
</head>

@@ -140,0 +140,0 @@

@@ -466,18 +466,26 @@ export type LogLevel = 'none' | 'info' | 'warn' | 'error'

export interface RadarMarkerImage {
url?: string;
radarMarkerId?: string;
width?: number;
height?: number;
}
export interface RadarMarkerPopupOptions extends maplibregl.PopupOptions {
text?: string;
html?: string;
element?: HTMLElement;
}
export interface RadarMarkerOptions extends maplibregl.MarkerOptions {
/**
* @deprecated Use popup.text
*/
text?: string;
/**
* @deprecated Use popup.html
*/
html?: string;
image?: RadarMarkerImage;
// marker configs
url?: string;
marker?: string;
width?: number;
height?: number;
// popup configs
popup?: RadarMarkerPopupOptions;

@@ -484,0 +492,0 @@ }

@@ -9,2 +9,3 @@ const RADAR_LOGO_URL = 'https://api.radar.io/maps/static/images/logo.svg';

img.src = RADAR_LOGO_URL;
img.alt = 'Radar Maps Platform';

@@ -11,0 +12,0 @@ this.link = document.createElement('a');

@@ -8,9 +8,12 @@ import maplibregl from 'maplibre-gl';

import type { RadarMarkerImage, RadarMarkerOptions } from '../types';
import type { RadarMarkerOptions } from '../types';
const defaultMarkerOptions: RadarMarkerOptions = {
color: '#000257',
};
interface ImageOptions {
url?: string;
width?: number;
height?: number;
}
const createImageElement = (options: RadarMarkerImage) => {
const createImageElement = (options: ImageOptions) => {
const element = document.createElement('img');

@@ -33,5 +36,9 @@ element.src = options.url!;

}
const defaultMarkerOptions: RadarMarkerOptions = {
color: '#000257',
};
class RadarMarker extends maplibregl.Marker {
_map!: RadarMap;
_image?: RadarMarkerImage;

@@ -41,2 +48,3 @@ constructor(markerOptions: RadarMarkerOptions) {

// init MapLibre marker configs
if (markerOptions.color) {

@@ -54,5 +62,4 @@ maplibreOptions.color = markerOptions.color;

if (markerOptions.image) {
this._image = markerOptions.image;
// handle marker images (Radar marker, or custom URL)
if (markerOptions.marker || markerOptions.url) {
const originalElement = this._element.cloneNode(true);

@@ -73,4 +80,4 @@ this._element.childNodes.forEach((child) => {

if (markerOptions.image.url) {
fetch(markerOptions.image.url)
if (markerOptions.url) {
fetch(markerOptions.url)
.then(res => {

@@ -88,3 +95,3 @@ if (res.status === 200) {

if (markerOptions.image.radarMarkerId) {
if (markerOptions.marker) {
// fetch custom marker

@@ -94,3 +101,3 @@ Http.request({

version: 'maps',
path: `markers/${markerOptions.image.radarMarkerId}`,
path: `markers/${markerOptions.marker}`,
responseType: 'blob',

@@ -105,2 +112,3 @@ })

if (markerOptions.text) {
Logger.warn('marker option "text" is deprecated, and will be removed in a future version. Use "popup.text".');
markerOptions.popup = markerOptions.popup || {};

@@ -110,2 +118,3 @@ markerOptions.popup!.text = markerOptions.text;

if (markerOptions.html) {
Logger.warn('marker option "html" is deprecated, and will be removed in a future version. Use "popup.html".');
markerOptions.popup = markerOptions.popup || {};

@@ -117,3 +126,3 @@ markerOptions.popup!.html = markerOptions.html;

if (markerOptions.popup) {
const popup = new maplibregl.Popup(markerOptions.popup)
const popup = new maplibregl.Popup(markerOptions.popup);

@@ -126,5 +135,20 @@ if (markerOptions.popup.text) {

}
if (markerOptions.popup.element) {
popup.setDOMContent(markerOptions.popup.element);
}
this.setPopup(popup);
}
// pass-through click event from element to marker
const element = this.getElement();
if (element) {
element.addEventListener('click', (e) => {
e.stopPropagation(); // stop propagation to map
if (this._popup) {
this.togglePopup();
}
this.fire('click', e);
});
}
}

@@ -131,0 +155,0 @@

@@ -1,1 +0,1 @@

export default '4.3.0-beta.8';
export default '4.3.0-beta.9';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc