Contents

init(batteryLevel:)

Creates additional route information for battery percentage.

Declaration

convenience init(batteryLevel: Double)

Parameters

  • batteryLevel:

    The battery level as a percentage from 0.0 (empty) to 100.0 (full). Values outside this range will be clamped.

Return Value

A new @c CPRouteDetail instance representing the battery level

Discussion

Use this method to display the estimated battery level upon arrival at the destination for electric vehicles. Display as a percentage (0.0 to 100.0) to show state of charge.

Percentage-based battery display is familiar to most users and provides an intuitive understanding of remaining range. The system formats this as a percentage with appropriate visual indicators. Values are clamped to the 0.0-100.0 range if necessary.