Skip to main content

Simple Routing

Calculate a route using Trimble Maps data for commercial vehicles and draw it on the map.

Simple Routing

Sample code

import { createRoutePlugin } from "@trimblemaps/plugins-react-native";
import { Camera, Map, TrimbleMaps } from "@trimblemaps/maps-react-native";

const ROUTE = {
  id: "simple-route",
  color: "#0063A3",
  routeOptions: {
    origin: { latitude: 40.361202, longitude: -74.599773 },
    destination: { latitude: 40.232968, longitude: -74.773348 },
  },
};

const plugin = createRoutePlugin(mapRef.current);
await plugin.addRoute(ROUTE);
await plugin.frameRoute(ROUTE.id);

Requires @trimblemaps/plugins-react-native. Route origin and destination use { latitude, longitude } objects.

Last updated November 5, 2026.