How to use the react-native-maps.Marker.propTypes function in react-native-maps

To help you get started, we’ve selected a few react-native-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 react-native-community / react-native-maps / example / examples / MyLocationMapMarker.js View on Github external
Platform,
} from 'react-native';
import { Marker } from 'react-native-maps';
import isEqual from 'lodash/isEqual';

const GEOLOCATION_OPTIONS = {
  enableHighAccuracy: true,
  timeout: 20000,
  maximumAge: 1000,
};
const ANCHOR = { x: 0.5, y: 0.5 };

const colorOfmyLocationMapMarker = 'blue';

const propTypes = {
  ...Marker.propTypes,
  // override this prop to make it optional
  coordinate: PropTypes.shape({
    latitude: PropTypes.number.isRequired,
    longitude: PropTypes.number.isRequired,
  }),
  children: PropTypes.node,
  geolocationOptions: PropTypes.shape({
    enableHighAccuracy: PropTypes.bool,
    timeout: PropTypes.number,
    maximumAge: PropTypes.number,
  }),
  heading: PropTypes.number,
  enableHack: PropTypes.bool,
};

const defaultProps = {
github expo / expo / apps / native-component-list / src / screens / Maps / MyLocationMapMarker.tsx View on Github external
import React from 'react';
import PropTypes from 'prop-types';

import { StyleSheet, Text, View, PermissionsAndroid, Platform } from 'react-native';
import isEqual from 'lodash/isEqual';
import { Marker } from 'react-native-maps';

const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 };
const ANCHOR = { x: 0.5, y: 0.5 };

const colorOfmyLocationMapMarker = 'blue';

const propTypes = {
  ...Marker.propTypes,
  // override this prop to make it optional
  coordinate: PropTypes.shape({
    latitude: PropTypes.number.isRequired,
    longitude: PropTypes.number.isRequired,
  }),
  children: PropTypes.node,
  geolocationOptions: PropTypes.shape({
    enableHighAccuracy: PropTypes.bool,
    timeout: PropTypes.number,
    maximumAge: PropTypes.number,
  }),
  heading: PropTypes.number,
  enableHack: PropTypes.bool,
};

const defaultProps = {