Skip to content

Commit

Permalink
0.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wirrareka committed Oct 18, 2024
1 parent a313f2b commit 8b9f274
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 83 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Proximi.io Map for React Native

## Changelog

### 0.9.4
- fixed imports

### 0.9.3
- included lib folder

Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
type Amenity,
type Feature,
log,
ProximiioMap,
type Route,
} from 'react-native-proximiio-map';
Expand All @@ -22,7 +23,6 @@ import Position from './components/position';
import { PermissionList, PlaceCoordinates, ProximiioToken } from './constants';
import Search from './components/search';
import SearchButton from './components/search-button';
import { log } from './common';
import { Icons } from './icons';

const style = StyleSheet.create({
Expand Down
12 changes: 0 additions & 12 deletions example/src/common.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
export const White90 = 'rgba(255, 255, 255, 0.9)';

export const log = (...args: any[]) => {
if (__DEV__) {
console.log(`${new Date().toISOString()} [Proximi.io] ${args}`);
}
};

export const debug = (..._args: any[]) => {
if (__DEV__) {
// console.log(`${new Date().toISOString()} [Proximi.io] ${args}`);
}
};
64 changes: 0 additions & 64 deletions example/src/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-proximiio-map",
"version": "0.9.3",
"version": "0.9.4",
"description": "Proximi.io Map for React Native",
"source": "./src/index.tsx",
"main": "./lib/commonjs/index.js",
Expand Down
83 changes: 78 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,85 @@
import { WebView, type WebViewMessageEvent } from 'react-native-webview';
import { type StyleProp, type ViewStyle } from 'react-native';
import { Component } from 'react';
import type {
FlyToOptions,
ProximiioRouteConfiguration,
} from '../example/src/types';

import { nanoid } from 'nanoid/non-secure';
import { debug } from '../example/src/common';

export type ProximiioRouteConfiguration = {
startFeatureId?: string;
startLatLonLevel?: number[];
destinationFeatureId?: string;
destinationLatLonLevel?: number[];
destinationTitle?: string | undefined;
waypointFeatureIdList?: string[][];
wayfindingOptions?: ProximiioWayfindingOptions;
};

export type ProximiioWayfindingOptions = {
avoidBarriers: boolean;
avoidElevators: boolean;
avoidEscalators: boolean;
avoidNarrowPaths: boolean;
avoidRamps: boolean;
avoidRevolvingDoors: boolean;
avoidStaircases: boolean;
avoidTicketGates: boolean;
pathFixDistance: number;
};

export type PointLike =
| {
x: number;
y: number;
}
| [number, number];

export type LngLat = {
lng: number;
lat: number;
};

export type LngLatLike =
| LngLat
| {
lng: number;
lat: number;
}
| {
lon: number;
lat: number;
}
| [number, number];

export type FlyToOptions = {
center?: LngLatLike;
zoom?: number;
bearing?: number;
pitch?: number;
around?: LngLatLike;
duration?: number;
easing?: (_: number) => number;
offset?: PointLike;
animate?: boolean;
essential?: boolean;
freezeElevation?: boolean;
curve?: number;
minZoom?: number;
speed?: number;
screenSpeed?: number;
maxDuration?: number;
};

export const log = (...args: any[]) => {
if (__DEV__) {
console.log(`${new Date().toISOString()} [Proximi.io] ${args}`);
}
};

export const debug = (..._args: any[]) => {
if (__DEV__) {
// console.log(`${new Date().toISOString()} [Proximi.io] ${args}`);
}
};

interface Props {
style?: StyleProp<ViewStyle>;
Expand Down

0 comments on commit 8b9f274

Please sign in to comment.