How to use the react-native-maps.AnimatedRegion 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 vikrantnegi / react-native-location-tracking / App.js View on Github external
constructor(props) {
    super(props);

    this.state = {
      latitude: LATITUDE,
      longitude: LONGITUDE,
      routeCoordinates: [],
      distanceTravelled: 0,
      prevLatLng: {},
      coordinate: new AnimatedRegion({
        latitude: LATITUDE,
        longitude: LONGITUDE,
        latitudeDelta: 0,
        longitudeDelta: 0
      })
    };
  }
github Mindinventory / Map-interaction-prototype / app / screens / MapScreen.js View on Github external
constructor(props) {
        super(props);

        mapintegration = this;
        this.state = {
            region: {
                latitude: LATITUDE,
                longitude: LONGITUDE,
                latitudeDelta: LATITUDE_DELTA,
                longitudeDelta: LONGITUDE_DELTA,
            },
            coordinate: new AnimatedRegion({
                latitude: LATITUDE_DEST1,
                longitude: LONGITUDE_DEST1,
            }),
            latitudeDestination: LATITUDE_DEST1,
            longitudeDestination: LONGITUDE_DEST1,
        };
    }
github react-native-community / react-native-maps / example / examples / AnimatedMarkers.js View on Github external
constructor(props) {
    super(props);

    this.state = {
      coordinate: new AnimatedRegion({
        latitude: LATITUDE,
        longitude: LONGITUDE,
      }),
    };
  }
github BalestraPatrick / appbuilders18app / Information / VenueLocationScreen.js View on Github external
constructor(props) {
    super(props);
    this.state = {
      coordinate: new AnimatedRegion({
        latitude: 46.005063,
        longitude: 8.956442,
        latitudeDelta: 0.02,
        longitudeDelta: 0.02
      }),
    }
  }
github Mindinventory / Map-interaction-prototype / App.js View on Github external
constructor(props) {
        super(props);

        mapStyle = this;
        this.state = {
            region: {
                latitude: LATITUDE,
                longitude: LONGITUDE,
                latitudeDelta: LATITUDE_DELTA,
                longitudeDelta: LONGITUDE_DELTA,
            },
            coordinate: new AnimatedRegion({
                latitude: LATITUDE_DEST1,
                longitude: LONGITUDE_DEST1,
            }),
            latitudeDestination: LATITUDE_DEST1,
            longitudeDestination: LONGITUDE_DEST1,
        };
    }
github UCSD / campus-mobile / app / views / map / Map.js View on Github external
nextProps.vehicles[route].forEach((nextVehicle) => {
							nextVehicle.animated = new MapView.AnimatedRegion({
								latitude: nextVehicle.lat,
								longitude: nextVehicle.lon,
							})
						})
github volga-volga / react-native-animated-map-clusters / src / ClusteringMap.js View on Github external
            this.getChildren().map((marker: Marker | MarkerAnimated) => new AnimatedRegion(marker.props.coordinate)),
        }, () => {
github react-native-community / react-native-maps / example / examples / AnimatedViews.js View on Github external
const animations = markers.map((m, i) =>
      getMarkerState(panX, panY, scrollY, i)
    );

    this.state = {
      panX,
      panY,
      animations,
      index: 0,
      canMoveHorizontal: true,
      scrollY,
      scrollX,
      scale,
      translateY,
      markers,
      region: new AnimatedRegion({
        latitude: LATITUDE,
        longitude: LONGITUDE,
        latitudeDelta: LATITUDE_DELTA,
        longitudeDelta: LONGITUDE_DELTA,
      }),
    };
  }
github volga-volga / react-native-animated-map-clusters / src / ClusteringMap.js View on Github external
clusters: clusters.map((i, index) => ({
          ...i,
          center: new AnimatedRegion(this.clusters[parents[index]].center),
        }))
      }, () => {
github expo / expo / apps / native-component-list / src / screens / Maps / AnimatedMarkers.tsx View on Github external
function AnimatedMarkers({ provider }: any) {
  const [coordinate] = React.useState(
    new AnimatedRegion({
      latitude: LATITUDE,
      longitude: LONGITUDE,
    })
  );

  let marker: any;

  const animate = () => {
    const newCoordinate = {
      latitude: LATITUDE + (Math.random() - 0.5) * (LATITUDE_DELTA / 2),
      longitude: LONGITUDE + (Math.random() - 0.5) * (LONGITUDE_DELTA / 2),
    };

    if (Platform.OS === 'android') {
      if (marker) {
        marker._component.animateMarkerToCoordinate(newCoordinate, 500);