Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/src/examples/Animations/AnimatedLineOffsets.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo, useRef, useState, useMemo, useCallback } from 'react';
import { Button, StyleProp, View, ViewStyle } from 'react-native';
import { Button, type StyleProp, View, type ViewStyle } from 'react-native';
import {
Camera,
Logger,
Expand All @@ -8,7 +8,7 @@ import {
__experimental,
LineLayer,
} from '@rnmapbox/maps';
import { Position } from 'geojson';
import { type Position } from 'geojson';
import { Divider, Slider, Text } from '@rneui/base';
import { SafeAreaView } from 'react-native-safe-area-context';
// @ts-ignore - @turf packages have type resolution issues with package.json exports
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/Animations/AnimatedPoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
CircleLayer,
__experimental,
} from '@rnmapbox/maps';
import { Position } from 'geojson';
import { type Position } from 'geojson';
import { Divider, Slider, Text } from '@rneui/base';
import { SafeAreaView } from 'react-native-safe-area-context';
import { View, Button, StyleProp, ViewStyle } from 'react-native';
import { View, Button, type StyleProp, type ViewStyle } from 'react-native';

import type { ExampleWithMetadata } from '../common/ExampleMetadata';

Expand Down
10 changes: 8 additions & 2 deletions example/src/examples/Annotations/CustomCallout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ import { useState } from 'react';
import Mapbox, { type SymbolLayerStyle } from '@rnmapbox/maps';
// @ts-ignore - @turf packages have type resolution issues with package.json exports
import { Feature } from '@turf/helpers';
import { StyleProp, Text, TextStyle, View, ViewStyle } from 'react-native';
import {
type StyleProp,
Text,
type TextStyle,
View,
type ViewStyle,
} from 'react-native';

import exampleIcon from '../../assets/pin.png';
import sheet from '../../styles/sheet';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const defaultCamera = {
centerCoordinate: [12.338, 45.4385],
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/Annotations/ShowPointAnnotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
ShapeSource,
getAnnotationsLayerID,
} from '@rnmapbox/maps';
import { Point, Position } from 'geojson';
import { type Point, type Position } from 'geojson';
import { Button } from '@rneui/base';

import Bubble from '../common/Bubble';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const ANNOTATION_SIZE = 40;

Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/BugReportExampleTS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ShapeSource,
SymbolLayer,
} from '@rnmapbox/maps';
import { FeatureCollection } from 'geojson';
import { type FeatureCollection } from 'geojson';
import { Button } from 'react-native';

const styles = {
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/CacheOffline/CacheManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
import sheet from '../../styles/sheet';
import { DEFAULT_CENTER_COORDINATE } from '../../utils';
import BaseExamplePropTypes, {
BaseExampleProps,
type BaseExampleProps,
} from '../common/BaseExamplePropTypes';
import { ExampleWithMetadata } from '../common/ExampleMetadata';
import { type ExampleWithMetadata } from '../common/ExampleMetadata';

const styles = StyleSheet.create({
button: {
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/CacheOffline/OfflineExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Mapbox, {
} from '@rnmapbox/maps';
import { Button, Dimensions, TextInput } from 'react-native';

import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const CENTER_COORD: [number, number] = [-73.970895, 40.723279];
const MAPBOX_VECTOR_TILE_SIZE = 512;
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/CacheOffline/OfflineTilesets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
VectorSource,
} from '@rnmapbox/maps';

import { ExampleWithMetadata } from '../common/ExampleMetadata';
import { type ExampleWithMetadata } from '../common/ExampleMetadata';

const packName = 'map-with-3d-terrain-pack';
const STYLE_URL = 'mapbox://styles/mapbox/satellite-streets-v11';
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Camera/Fit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import isEqual from 'lodash.isequal';
import { MapView, Camera, StyleURL, type CameraBounds } from '@rnmapbox/maps';

import sheet from '../../styles/sheet';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

// Assertion function to ensure camera is not null
function assertCameraNotNull(camera: Camera | null): asserts camera is Camera {
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/LineLayer/DrawPolyline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, View } from 'react-native';
import {
useState,
useRef,
ComponentProps,
type ComponentProps,
useMemo,
forwardRef,
type ElementRef,
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/CameraGestureObserver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback, useState } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { MapView, Camera, CameraGestureObserver, type OnMapSteadyEvent } from '@rnmapbox/maps';

import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const styles = StyleSheet.create({
container: {
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/DynamicUrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@rnmapbox/maps';

import Bubble from '../common/Bubble';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const randomCountries = [
{
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/LocalizeLabels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Camera, MapView } from '@rnmapbox/maps';

const CENTER_COORD = [-74.00597, 40.71427];

import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const LocalizeLabels = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/MapFps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Mapbox from '@rnmapbox/maps';
import { Button } from '@rneui/base';

import sheet from '../../styles/sheet';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const MapFps = () => {
const [frameRate, setFrameRate] = useState(60);
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/Map/MapInModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { Button, Text } from 'react-native';
import { MapView } from '@rnmapbox/maps';
import { SafeAreaView } from 'react-native-safe-area-context';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { ParamListBase } from '@react-navigation/native';
import { type NativeStackNavigationProp } from '@react-navigation/native-stack';
import { type ParamListBase } from '@react-navigation/native';

type MapInModalProps = {
navigation?: NativeStackNavigationProp<ParamListBase, string, undefined>;
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/MapUnMount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
import { Button } from 'react-native';

import sheet from '../../styles/sheet';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const MapUnMount = () => {
const [isMounted, setIsMounted] = useState(true);
Expand Down
9 changes: 7 additions & 2 deletions example/src/examples/Map/Ornaments.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { MapView, Camera, Images } from '@rnmapbox/maps';
import { useState } from 'react';
import { Button, ImageSourcePropType, StyleSheet, Text } from 'react-native';
import {
Button,
type ImageSourcePropType,
StyleSheet,
Text,
} from 'react-native';
import { Divider } from '@rneui/base';

import Bubble from '../common/Bubble';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

type CompassImage = 'compass1' | 'compass2';
const images: Record<CompassImage, ImageSourcePropType> = {
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/ShowMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ButtonGroup } from '@rneui/base';

import sheet from '../../styles/sheet';
import { onSortOptions } from '../../utils';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const ShowMap = () => {
const _mapOptions = Object.keys(Mapbox.StyleURL)
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/Map/ShowMapLocalStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Alert } from 'react-native';
import Mapbox from '@rnmapbox/maps';

import sheet from '../../styles/sheet';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const style = JSON.stringify(require('../../assets/map-styleURL-style.json'));

Expand Down
10 changes: 5 additions & 5 deletions example/src/examples/SymbolCircleLayer/Earthquakes.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
Camera,
CircleLayer,
CircleLayerStyle,
type CircleLayerStyle,
MapView,
ShapeSource,
SymbolLayer,
SymbolLayerStyle,
type SymbolLayerStyle,
StyleURL,
} from '@rnmapbox/maps';
import { FeatureCollection } from 'geojson';
import { type FeatureCollection } from 'geojson';
import React, { useRef, useState } from 'react';
import { FAB, Icon, ListItem } from '@rneui/base';
import moment from 'moment';
Expand All @@ -17,8 +17,8 @@ import { SafeAreaView } from 'react-native-safe-area-context';

import earthQuakesJSON from '../../assets/earthquakes.json';
import { SF_OFFICE_COORDINATE } from '../../utils';
import { ExampleWithMetadata } from '../common/ExampleMetadata';
import { BaseExampleProps } from '../common/BaseExamplePropTypes';
import { type ExampleWithMetadata } from '../common/ExampleMetadata';
import { type BaseExampleProps } from '../common/BaseExamplePropTypes';

const layerStyles: {
singlePoint: CircleLayerStyle;
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/SymbolCircleLayer/ImageScaleTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
Camera,
CircleLayer,
} from '@rnmapbox/maps';
import { ComponentProps } from 'react';
import { View, Image, Text, ImageSourcePropType } from 'react-native';
import { type ComponentProps } from 'react';
import { View, Image, Text, type ImageSourcePropType } from 'react-native';

const styles = {
mapView: { flex: 1 },
Expand Down
8 changes: 4 additions & 4 deletions example/src/examples/SymbolCircleLayer/ShapeSourceIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
SymbolLayer,
ShapeSource,
} from '@rnmapbox/maps';
import { StyleProp, Text, ViewStyle } from 'react-native';
import { FeatureCollection } from 'geojson';
import { type StyleProp, Text, type ViewStyle } from 'react-native';
import { type FeatureCollection } from 'geojson';

import exampleIcon from '../../assets/example.png';
import pinIcon from '../../assets/pin.png';
import { SymbolLayerStyleProps } from '../../../../src/utils/MapboxStyles';
import { ExampleWithMetadata } from '../common/ExampleMetadata';
import { type SymbolLayerStyleProps } from '../../../../src/utils/MapboxStyles';
import { type ExampleWithMetadata } from '../common/ExampleMetadata';

const styles: {
icon: SymbolLayerStyleProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Image,
} from '@rnmapbox/maps';

import { ExampleWithMetadata } from '../common/ExampleMetadata';
import { type ExampleWithMetadata } from '../common/ExampleMetadata';

const styles = { matchParent: { flex: 1 } };

Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/UserLocation/UserLocationPadding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { ButtonGroup } from '@rneui/base';
import { SafeAreaView } from 'react-native-safe-area-context';

import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-example-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-example-doc

enum Alignment {
Top = 'TOP',
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/UserLocation/UserLocationRenderMode.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode, useState } from 'react';
import { type ReactNode, useState } from 'react';
import {
MapView,
CircleLayer,
Expand All @@ -12,7 +12,7 @@ import { SafeAreaView } from 'react-native-safe-area-context';
import { ButtonGroup, Text } from '@rneui/base';

import { DEFAULT_CENTER_COORDINATE } from '../../utils';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const SettingsGroup = ({
children,
Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/UserLocation/UserLocationUpdates.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState } from 'react';
import { Text } from 'react-native';
import { MapView, Camera, UserLocation, Location } from '@rnmapbox/maps';
import { MapView, Camera, UserLocation, type Location } from '@rnmapbox/maps';

import Bubble from '../common/Bubble';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-example-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-example-doc

const UserLocationUpdates = () => {
const [location, setLocation] = useState<Location>();
Expand Down
8 changes: 4 additions & 4 deletions example/src/examples/V10/CameraAnimation.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { CheckBox, Divider, Slider, Button } from '@rneui/base';
import {
Camera,
CameraAnimationMode,
CameraBounds,
type CameraAnimationMode,
type CameraBounds,
CircleLayer,
Logger,
MapView,
ShapeSource,
} from '@rnmapbox/maps';
import bbox from '@turf/bbox';
import { Feature, Point, Position } from 'geojson';
import { type Feature, type Point, type Position } from 'geojson';
import { useCallback, useMemo, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

import colors from '../../styles/colors';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

Logger.setLogLevel('verbose');

Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/V10/FeatureState.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentProps, useCallback, useRef } from 'react';
import { type ComponentProps, useCallback, useRef } from 'react';
import { Camera, FillLayer, MapView, ShapeSource } from '@rnmapbox/maps';

import { ExampleWithMetadata } from '../common/ExampleMetadata';
import { type ExampleWithMetadata } from '../common/ExampleMetadata';

type CustomProperties = {
normalColor: string;
Expand Down
2 changes: 1 addition & 1 deletion example/src/examples/V10/GlobeProjection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Camera,
} from '@rnmapbox/maps';

import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

Logger.setLogLevel('verbose');

Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/V10/Markers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useCallback, useEffect, useState } from 'react';
import { StyleSheet, Pressable, Text, View } from 'react-native';
import { Button, Divider } from '@rneui/base';
import { Camera, Logger, MapView, MarkerView } from '@rnmapbox/maps';
import { Position } from 'geojson';
import { type Position } from 'geojson';

import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc
import { type ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

Logger.setLogLevel('verbose');

Expand Down
4 changes: 2 additions & 2 deletions example/src/examples/common/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { View } from 'react-native';
import sheet from '../../styles/sheet';
import colors from '../../styles/colors';

import { BaseExampleProps } from './BaseExamplePropTypes';
import { type BaseExampleProps } from './BaseExamplePropTypes';
import MapHeader from './MapHeader';
import { ReactNode } from 'react';
import { type ReactNode } from 'react';

export type PageProps = BaseExampleProps & { children: ReactNode };

Expand Down
2 changes: 1 addition & 1 deletion example/src/scenes/GroupAndItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import type { BaseExampleProps } from '../examples/common/BaseExamplePropTypes';

import MapHeader from '../examples/common/MapHeader';
import Page, { PageProps } from '../examples/common/Page';
import Page, { type PageProps } from '../examples/common/Page';
import sheet from '../styles/sheet';
// ANIMATIONS
import * as Animations from '../examples/Animations';
Expand Down
Loading
Loading