How to use the @react-native-mapbox-gl/maps.setConnected function in @react-native-mapbox-gl/maps

To help you get started, we’ve selected a few @react-native-mapbox-gl/maps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digidem / mapeo-mobile / src / frontend / sharedComponents / MapView.js View on Github external
import { LocationFollowingIcon, LocationNoFollowIcon } from "./icons";
import IconButton from "./IconButton";
import withNavigationFocus from "../lib/withNavigationFocus";
import type {
  LocationContextType,
  PositionType
} from "../context/LocationContext";
import type { ObservationsMap } from "../context/ObservationsContext";
import bugsnag from "../lib/logger";
import config from "../../config.json";
import Loading from "./Loading";

MapboxGL.setAccessToken(config.mapboxAccessToken);
// Forces Mapbox to always be in connected state, rather than reading system
// connectivity state
MapboxGL.setConnected(true);

const mapboxStyles = {
  observation: {
    circleColor: "#F29D4B",
    circleRadius: 5,
    circleStrokeColor: "#fff",
    circleStrokeWidth: 2
  }
};

type ObservationFeature = {
  type: "Feature",
  geometry: {
    type: "Point",
    coordinates: [number, number] | [number, number, number]
  },