@magiclane/maps-sdk
    Preparing search index...

    Class CarProfile

    Car routing profile.

    Profile used for car routing. Extends MotorVehicleProfile and exposes parameters relevant when computing car routes.

    Hierarchy (View Summary)

    Index

    Constructors

    • Car profile constructor with predefined FuelType.petrol as fuel type.

      Parameters

      • Optionaloptions: { fuel?: FuelType; mass?: number; maxSpeed?: number; plateNumber?: string }

        Configuration options

        • Optionalfuel?: FuelType

          Engine fuel type (default FuelType.petrol).

        • Optionalmass?: number

          Mass in kg (default 0).

        • OptionalmaxSpeed?: number

          Max speed in m/s (default 0).

        • OptionalplateNumber?: string

          Registration plate number (inherited).

      Returns CarProfile

    Properties

    fuel: FuelType

    Engine fuel type. Default is FuelType.petrol.

    mass: number

    Vehicle mass in kg. By default it is 0 and is not considered in routing.

    maxSpeed: number

    Vehicle maximum speed in m/s. By default it is 0 and is not considered in routing.

    plateNumber: string = ''

    The vehicle's registration plate number.

    Methods

    • Get hash code for use in maps/sets

      Returns number

    • Parameters

      • str: string

      Returns number

    • Internal

      Serializes this instance to a JSON-compatible map.

      Used internally, not intended for direct use by consumers. The map structure may change without notice.

      Returns Record<string, any>

      JSON-compatible map

    • Internal

      Deserializes a JSON-compatible map to create an instance.

      Used internally, not intended for direct use by consumers. The expected map structure may change without notice.

      Parameters

      • json: any

        JSON-compatible map

      Returns CarProfile

      A new CarProfile instance