Map Styles
Set the map to night, day, satellite, or multiple other styles by updating the mapStyle prop.
Sample code
import { useState } from "react";
import { Camera, Map, TrimbleMaps } from "@trimblemaps/maps-react-native";
function MapStyles() {
const [styleUrl, setStyleUrl] = useState(TrimbleMaps.StyleURL.MobileDay);
const changeMapStyle = () => {
setStyleUrl(TrimbleMaps.StyleURL.MobileNight);
};
return (
<Map mapStyle={styleUrl} style={{ flex: 1 }}>
<Camera initialViewState={{ center: [-74.006, 40.7128], zoom: 12 }} />
</Map>
);
}
Trimble layer visibility props are preserved when the style reloads.