
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@belom88/vehicle-layer
Advanced tools
Visualize transit vehicles on a map easily.
VehicleLayer package is a deck.gl layer. It is developed to visualize different vehicle types, for instance, transit buses and trams. The layer can visualize vehicles in 2D or 3D modes.
import { Deck } from '@deck.gl/core';
import { VehicleLayer, VehicleType } from '@belom88/vehicle-layer';
const INITIAL_VIEW_STATE = {
latitude: 53.431798446246546,
longitude: -2.957781323439993,
zoom: 20,
};
const deckgl = new Deck({
initialViewState: INITIAL_VIEW_STATE,
controller: true,
layers: [
new VehicleLayer({
id: 'vehicle-layer',
data: [
{
latitude: 53.43185529968051,
longitude: -2.9577037905967574,
bearing: -51.94099460927194,
vehilceType: VehicleType.TransitBus,
},
{
latitude: 53.431755073582494,
longitude: -2.9578708705967136,
bearing: -51.94099460927194,
vehilceType: VehicleType.Tram,
},
],
dimensionMode: '3D',
getColor: [238, 255, 203],
getPosition: (vehicle) => [vehicle.longitude, vehicle.latitude],
getBearing: (vehicle) => vehicle.bearing,
getVehicleType: (vehicle) => vehicle.vehilceType,
}),
],
});
The compatibility table mentions deck.gl version that was used to build the specific version of VehicleLayer. However the specific version of VehicleLayer might be compatible with other deck.gl versions although not tested with.
VehicleLayer | built on deck.gl |
---|---|
0.0.X | ^8.9.21 |
Vehicle type is a number that encodes a type of vehicle. VehicleType
enum can be imported to define vehicle types in a human readable way.
VehicleType | Code |
---|---|
TransitBus | 0 |
Tram | 1 |
Size mode is a number that encodes a way to set size of vehicles. VehicleSizeMode
enum can be imported to define size mode in a human readable way.
VehicleSizeMode | Code | Description |
---|---|---|
Original | 0 | 3D - get original size of 3D model. 2D - icon size is set in meters and multiplied by 5. The size might be scaled with sizeScale property. |
Pixel | 1 | 3D - size of vehicle is rescaled to be approximately equal to the size in pixels. 2D - icon size is set in pixels. The size is set with size property |
Combined | 2 | 3D - Original size mode behavior, 2D - Pixel size mode behavior |
type: T[]
where T is a Vehicle object type;
default: []
description: Array of vehicles objects. Vehicle object must containt position information.
type: '2D' or '3D'
default: '3D'
description: In 2D
mode vehicles are shown as arrow icons. In 3D
mode vehicles are shown as 3D models.
type: VehicleSizeMode
default: VehicleSizeMode.Original
description: Change the way to set size of vehicles.
type: number
default: 20
description: Pixel size of vehicles. This property is active when sizeMode
property is set to Pixel
or dimensionMode
is set to 2D
and sizeMode
is set to Combined
.
type: number
default: 1
description: For 3D - scale multiplier for all dimensions. For 2D - icon size (in meters) multiplied by 5. This property is active when sizeMode
property is set to Original
or dimensionMode
is set to 3D
and sizeMode
is set to Combined
type: Accessor<TProps, number>
default: 0
description: deck.gl accessor that transforms vehicle data to the movement direction of the vehicle.
type: Accessor<TProps, Color>
default: [255, 255, 255]
description: deck.gl accessor that transforms vehicle data to the vehicle color.
type: Accessor<TProps, Color>
default: undefined
description: deck.gl accessor that transforms vehicle data to the color of 3D model. This accessor overrides getColor
accessor.
type: Accessor<TProps, Color>
default: [255, 255, 255]
description: deck.gl accessor that transforms vehicle data to the background color of 2D icon.
type: Accessor<TProps, Color>
default: [0, 0, 0]
description: deck.gl accessor that transforms vehicle data to the foreground color of 2D icon. This accessor overrides getColor
accessor.
type: Accessor<TProps, VehicleType>
default: VehicleType.TransitBus
description: deck.gl accessor that transforms vehicle data to a vehicle type.
FAQs
Visualize transit vehicles on a map easily.
We found that @belom88/vehicle-layer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.