Public Transport
This example demonstrates how to calculate and display public transit routes including walking segments, bus segments, and fare information.
Overview
The example demonstrates the following features:
- Public transit route calculation
- Walking and bus segments in a route
- Route fare and time/distance display
- Route selection and alternative routes
Process and Display Public Transit Segments
SDK Initialization and Map Creation
Calculate and Display Public Transit Route
Live Demo
Key Features
- Public Transit Routing: Calculates routes using public transport, including walking and bus segments.
- Segment Extraction: Converts routes to public transit segments for detailed display.
- Route Selection: Allows users to select alternative routes by tapping on the map.
- Fare and Time Display: Shows fare, time, and distance for each route.
Explanation of Key Components
- GemKit.initialize: Initializes the SDK and prepares the map for routing.
- RoutingService.calculateRoute: Calculates routes between landmarks using public transport mode.
- PTRoute & PTRouteSegment: Represent public transit routes and their individual segments (walking, bus, etc.).
- registerTouchCallback: Enables route selection by tapping on the map.
Next Steps
- Route Profile - Customize route preferences and profiles