Skip to Content
MapQuest SDK

Maps and location

Once you can show a map, give it a starting point. A map of a destination needs no location permission; ask for location only if the user wants the map to follow them.

For additional map and camera props, see the MapLibre React Native references for Map and Camera.

Open the map on a place

Map draws the map while Camera controls which part of it is visible. Add Camera as a child of Map and give it a center in [longitude, latitude] order. This screen opens on downtown Denver:

import { Camera } from '@mapquest/expo-maplibre'
import { Map } from '@mapquest/sdk'

export default function MapScreen() {
  return (
    <Map style={{ flex: 1 }}>
      <Camera center={[-104.9903, 39.7392]} zoom={14} />
    </Map>
  )
}

Increase zoom to see individual streets, or decrease it to show more of the city. To show a different destination, change center.

Choose a map style

By default the map follows the app's light or dark appearance. To follow the device setting on iOS, set ios.userInterfaceStyle to 'automatic' in your Expo config.

To use a fixed map style, set the theme prop to one of the following themes:

ValueDescription
MapTheme.LIGHTA light street map for daytime use or a light app theme.
MapTheme.DARKA dark street map for low-light settings or a dark app theme.
MapTheme.SATELLITESatellite imagery with road outlines and street names overlaid.
MapTheme.GRAYSCALEA street map with muted colors that help routes and markers stand out.

On this page