Skip to main content

Geocoding

Geocode an address from a search query and zoom to that location on the map.

Geocoding

Sample code

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

const response = await geocode("1 Independence Way Princeton NJ 08540");
const location = response.locations?.[0];

if (location?.coords) {
  const { lat, lon } = location.coords;
  cameraRef.current?.flyTo({
    center: [lon, lat],
    zoom: 13,
    duration: 500,
  });
}

Requires @trimblemaps/services-react-native and an initialized account.

Last updated November 5, 2026.