Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@getcircuit/web-map
Advanced tools
@getcircuit/web-map
Circuit Schema | Svelte Documentation | Google Maps Documentation
The general way to use this component is to instantiate it as you would with any other Svelte component.
import CircuitMap from '@getcircuit/web-map'
import ReactDOM from 'react-dom/client'
import React from 'react'
import { DriverAvatar } from '@getcircuit/components'
import { AttemptedLocationCard } from '../somewhere'
const mapInstance = new CircuitMap({
target: document.querySelector('#map'),
props: {
apiKey: '...',
mapOptions: {
center: { lat: 51.509865, lng: -0.118092 },
zoom: 15,
},
react: {
React,
ReactDOM,
components: {
DriverAvatar,
AttemptedLocationCard,
},
},
},
})
apiKey
Google Maps API key.
mapOptions
Google maps options object.
setIntl(newIntl: IntlStore): void
Updates the map's Intl bag. An Intl bag is an object composed of the following properties:
type IntlBag {
/** Current locale */
locale: string
/** Method that returns a localized message given a message id */
formatMessage: (messageId: string, values?: Record<string, any>) => string
/** Method that formats an epoch timestamp given the current locale */
formatEpoch: (epoch: EpochTimestamp) => string
}
setMapOptions(options: google.maps.MapOptions): void
Updates map's Google Map options.
setCenter(center: google.maps.LatLngLiteral | google.maps.LatLng): void
Changes the center of the map to the specified point.
fitCoordinates(coords?: google.maps.LatLngLiteral[]): void
Moves the map camera to fit all the passed coordinates.
setPlan(newPlan?: PlanBundle): void
Updates the current plan that is being displayed on the map. Set to undefined
to remove the current plan.
focusRoute(routeId: string): void
Focuses the given route on the map.
focusStop(stopId: string): void
Focuses the given stop on the map.
resetFocus(): void
Resets the map focus state.
hoverRoute(routeId: string): void
Hovers the given route on the map.
hoverStop(stopId: string): void
Hovers the given stop on the map.
resetHover(): void
Resets the map hover state.
openAttemptedLocationCard(): void
Opens the Attempted Location Card component for the current focused stop.
closeAttemptedLocationCard(): void
Closes the Attempted Location Card component.
The map camera should behave as stated below:
CubicInOut
for 600ms when there’s no change to zoom levels, regardless of the distance between points A and B.0
duration).16
, maximum zoom level is not defined.16
if the stop being focused has an attempted location more than 100 meters away from the original stop location and the user is on a zoom level lower than 16
. If user is on a greater zoom level, try to fit the stop and attempted markers with the current zoom level.px
50px
in all directions.TBD
There are 2 different types of markers:
Detailed markers can show additional information about the stop like their number if used for an optimized stop as well as different state-dependent symbols. They don't have to show anything, f.e. when used for unoptimized stops.
The color preset of a detailed marker depends on its stop state with the following precedence:
neutral
color preset.error
color preset.error
color preset.neutral
color preset.route's
color preset.route's
color preset.default
color preset.Apart from the color preset, the colors that will be used depend on the marker variant. The available variants are: primary
, secondary
, focused
.
focused
if the stop is focused.primary
if any of the following are true
:
secondary
if any of the following are true
:
end
.A detailed marker can have one of four different widths: 1
to 4
, used depending on how much content needs to be shown inside the marker.
Width 1
:
Width 2
:
Width 3
:
Width 4
:
symbol
onlytext
onlytext
and symbol
deleted
symbol.unreachable
symbol.unoptimized
symbol.start location
, use start
symbol.end location
, use end
symbol.failure
symbol.success
symbol.edited
symbol.first
use orderFirst
symbol.last
use orderLast
symbol.pickup
symbol.first
use orderFirst
symbol.last
use orderLast
symbol.pickup
symbol.unoptimized
symbol.Any symbol listed above can be replaced by one of higher precedence.
For stops that are not a terminal location, the priority order of its symbol is:
Deleted
> Unreachable
> Added
> Edited
> Failure
> Success
> Issue
> Pickup
> ASAP
Minimal markers are used to reduce the visual overlap of markers on dense routes, allowing the user to get a better view of the planned routes.
Compared to detailed markers, they are smaller and don't show any text. Also, only the start / end / skipped symbols are shown where applicable.
The color preset of a minimal marker depends on its stop state with the following precedence:
error
color preset.route's
color preset.default
color preset.Apart from the color preset, the colors that will be used depend on the marker variant. The available variants are: focused
, primary
, secondary
, tertiary
and unassigned
.
focused
if the stop is focused.unassigned
if the stop isn't assigned to a route and it's not focused.primary
if any of the following are true
:
secondary
if any of the following are true
:
end
.tertiary
if the batch-edit selection-mode is active and the stop is not done.A minimal marker can have one of two different widths: 1
and 2
.
Width 1
:
Width 2
:
symbol
onlyunreachable
symbol.start location
, use start
symbol.end location
, use end
symbol.FAQs
Unknown package
We found that @getcircuit/web-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 19 open source maintainers 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.