Add initial implementation of Map SDK and example app
- Create README for the main repository and example app - Implement example app with MapView and Marker components - Add package.json for example app with necessary scripts and dependencies - Create Map SDK package with TypeScript wrapper around react-native-maps - Define TypeScript configuration for the SDK
This commit is contained in:
21
example/App.tsx
Normal file
21
example/App.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
import { SafeAreaView, StyleSheet } from 'react-native';
|
||||
import { MapView, Marker } from '@lynkedup/map-sdk';
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<SafeAreaView style={styles.container}>
|
||||
<MapView
|
||||
style={styles.map}
|
||||
initialRegion={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.0922, longitudeDelta: 0.0421 }}
|
||||
>
|
||||
<Marker coordinate={{ latitude: 37.78825, longitude: -122.4324 }} />
|
||||
</MapView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: { flex: 1 },
|
||||
map: { flex: 1 }
|
||||
});
|
||||
15
example/README.md
Normal file
15
example/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Example App
|
||||
|
||||
This example demonstrates usage of `@lynkedup/map-sdk`.
|
||||
|
||||
Setup:
|
||||
|
||||
1. From repo root run `npm run bootstrap` to install workspace packages.
|
||||
2. From `example` run `npm install` to install native deps.
|
||||
3. iOS: run `npx pod-install ios` and add your Google Maps API key if you use Google provider.
|
||||
4. Android: ensure Google Play services and API keys are set in `AndroidManifest.xml` if using Google maps.
|
||||
|
||||
Run:
|
||||
- `npm run ios` or `npm run android` from `example` folder.
|
||||
|
||||
See `react-native-maps` docs for platform-specific instructions: https://github.com/react-native-maps/react-native-maps
|
||||
16
example/package.json
Normal file
16
example/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "example",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"start": "react-native start",
|
||||
"ios": "react-native run-ios",
|
||||
"android": "react-native run-android"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "18.2.0",
|
||||
"react-native": "0.71.0",
|
||||
"react-native-maps": "^1.3.2",
|
||||
"@lynkedup/map-sdk": "*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user