@mappedin/react-native-sdk 6.0.0-alpha.11 → 6.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,17 +1,22 @@
1
1
  # @mappedin/react-native-sdk
2
2
 
3
- A React Native SDK for integrating Mappedin's indoor mapping and navigation capabilities into React Native applications. This SDK provides a native wrapper around Mappedin's web-based mapping technology using WebView for cross-platform compatibility.
3
+ Mappedin SDK for React Native SDK enables integration of Mappedin's indoor mapping and navigation capabilities into React Native applications. This SDK provides a native wrapper around Mappedin's web-based mapping technology using WebView for cross-platform compatibility.
4
4
 
5
5
  ## ✨ Features
6
6
 
7
- - 📱 **Cross-Platform Excellence** - Write once, deploy everywhere with confidence
7
+ - 📱 **Cross-Platform** - Write once, deploy everywhere with confidence
8
8
  - 🎯 **Interactive Indoor Maps** - Smooth zoom, pan, and rotation controls that feel natural
9
9
  - 🧭 **Smart Navigation & Wayfinding** - Clear turn-by-turn directions your users will love
10
10
  - 📍 **Points of Interest** - Beautifully showcase venue locations and amenities
11
- - 🔄 **Real-time Updates** - Keep your maps fresh with live location tracking
12
- - 🌐 **WebView-Powered** - Built on proven, reliable web technology
13
11
  - ⚡ **Event-Driven** - Comprehensive event system for seamless interactions
14
12
 
13
+ ## 🆘 Support & Resources
14
+
15
+ - 👨‍💻 [Mappedin Developer Portal](https://developer.mappedin.com/)
16
+ - 📖 [Mappedin SDK for React Native Guides](https://developer.mappedin.com/react-native-sdk/getting-started)
17
+ - 📋 [API Documentation](https://docs.mappedin.com/react-native-sdk-api/v6/latest/)
18
+ - 💬 [Community Forum](https://community.mappedin.com/)
19
+
15
20
  ## 📦 Installation
16
21
 
17
22
  ```bash
@@ -44,59 +49,61 @@ import { View, StyleSheet } from 'react-native';
44
49
  import { MapView, useMap } from '@mappedin/react-native-sdk';
45
50
 
46
51
  const MapSetup = () => {
47
- const { mapData, mapView } = useMap();
48
-
49
- useEffect(() => {
50
- if (mapData && mapView) {
51
- console.log('Map is ready!');
52
-
53
- async function initializeMap() {
54
- // Display all venue labels
55
- mapView.Labels.all();
56
-
57
- // Expand stacked maps with automatic spacing
58
- await mapView.StackedMaps.expand({
59
- distanceBetweenFloors: 'auto'
60
- });
61
-
62
- // Optional: Create a smooth tour through all spaces
63
- for (const space of mapData.getByType('space')) {
64
- await mapView.Camera.focusOn(space, {
65
- duration: 1000,
66
- easing: 'ease-in-out',
67
- });
68
- }
69
- }
70
-
71
- initializeMap();
72
- }
73
- }, [mapData, mapView]);
74
-
75
- return null;
52
+ const { mapData, mapView } = useMap();
53
+
54
+ useEffect(() => {
55
+ if (mapData && mapView) {
56
+ console.log('Map is ready!');
57
+
58
+ async function initializeMap() {
59
+ // Display all venue labels
60
+ mapView.Labels.all();
61
+
62
+ // Expand stacked maps with automatic spacing
63
+ await mapView.StackedMaps.expand({
64
+ distanceBetweenFloors: 'auto',
65
+ });
66
+
67
+ // Optional: Create a smooth tour through all spaces
68
+ for (const space of mapData.getByType('space')) {
69
+ await mapView.Camera.focusOn(space, {
70
+ duration: 1000,
71
+ easing: 'ease-in-out',
72
+ });
73
+ }
74
+ }
75
+
76
+ initializeMap();
77
+ }
78
+ }, [mapData, mapView]);
79
+
80
+ return null;
76
81
  };
77
82
 
83
+ // Add your Mappedin key, secret and map ID or use a demo key and map
84
+ // Demo Key & Maps: https://developer.mappedin.com/docs/demo-keys-and-maps
78
85
  const App = () => {
79
- return (
80
- <View style={styles.container}>
81
- <MapView
82
- options={{}}
83
- mapData={{
84
- key: 'your-mappedin-key',
85
- secret: 'your-mappedin-secret',
86
- mapId: 'your-map-id',
87
- }}
88
- >
89
- <MapSetup />
90
- </MapView>
91
- </View>
92
- );
86
+ return (
87
+ <View style={styles.container}>
88
+ <MapView
89
+ options={{}}
90
+ mapData={{
91
+ key: 'your-mappedin-key',
92
+ secret: 'your-mappedin-secret',
93
+ mapId: 'your-map-id',
94
+ }}
95
+ >
96
+ <MapSetup />
97
+ </MapView>
98
+ </View>
99
+ );
93
100
  };
94
101
 
95
102
  const styles = StyleSheet.create({
96
- container: {
97
- flex: 1,
98
- backgroundColor: '#f0f8ff',
99
- },
103
+ container: {
104
+ flex: 1,
105
+ backgroundColor: '#f0f8ff',
106
+ },
100
107
  });
101
108
 
102
109
  export default App;
@@ -109,35 +116,39 @@ import React from 'react';
109
116
  import { MapView, useMap } from '@mappedin/react-native-sdk';
110
117
 
111
118
  const CustomMapComponent = () => {
112
- const { mapData, mapView } = useMap();
113
-
114
- const handleSpaceClick = async (space) => {
115
- // Focus on clicked space with smooth animation
116
- await mapView.Camera.focusOn(space, {
117
- duration: 1500,
118
- easing: 'ease-out',
119
- });
120
- };
121
-
122
- return (
123
- <MapView
124
- style={{ flex: 1 }}
125
- mapData={{
126
- key: 'mik_your_key_here',
127
- secret: 'mis_your_secret_here',
128
- mapId: 'your_map_id_here',
129
- }}
130
- options={{
131
- // Custom options go here
132
- }}
133
- >
134
- {/* Your custom map setup logic */}
135
- </MapView>
136
- );
119
+ const { mapData, mapView } = useMap();
120
+
121
+ const handleSpaceClick = async space => {
122
+ // Focus on clicked space with smooth animation
123
+ await mapView.Camera.focusOn(space, {
124
+ duration: 1500,
125
+ easing: 'ease-out',
126
+ });
127
+ };
128
+
129
+ // Add your Mappedin key, secret and map ID or use a demo key and map
130
+ // Demo Key & Maps: https://developer.mappedin.com/docs/demo-keys-and-maps
131
+ return (
132
+ <MapView
133
+ style={{ flex: 1 }}
134
+ mapData={{
135
+ key: 'mik_your_key_here',
136
+ secret: 'mis_your_secret_here',
137
+ mapId: 'your_map_id_here',
138
+ }}
139
+ options={
140
+ {
141
+ // Custom options go here
142
+ }
143
+ }
144
+ >
145
+ {/* Your custom map setup logic */}
146
+ </MapView>
147
+ );
137
148
  };
138
149
  ```
139
150
 
140
- ## 🔧 API Reference
151
+ ## 🔧 API Summary
141
152
 
142
153
  ### Components
143
154
 
@@ -146,6 +157,7 @@ const CustomMapComponent = () => {
146
157
  The main component that renders your indoor map with powerful mapping capabilities.
147
158
 
148
159
  **Props:**
160
+
149
161
  - `mapData` - Configuration object containing your Mappedin credentials
150
162
  - `options` - Additional map configuration options
151
163
  - `style` - ViewStyle for the map container
@@ -156,6 +168,7 @@ The main component that renders your indoor map with powerful mapping capabiliti
156
168
  Access map data and view controls from any child component.
157
169
 
158
170
  **Returns:**
171
+
159
172
  - `mapData` - Venue data and spatial information
160
173
  - `mapView` - Map control methods and interactions
161
174
 
@@ -171,31 +184,22 @@ mapView.Labels.hide(); // Hide all labels
171
184
 
172
185
  // Stacked Maps
173
186
  await mapView.StackedMaps.expand({
174
- distanceBetweenFloors: 'auto' | number
187
+ distanceBetweenFloors: 'auto' | number,
175
188
  });
176
189
  ```
177
190
 
178
191
  ## 📚 Examples
179
192
 
180
193
  Check out our example app in `apps/rn-example/` for more detailed implementations, including:
194
+
181
195
  - Basic map initialization
182
196
  - Custom styling and theming
183
197
  - Navigation and routing
184
198
  - Event handling
185
199
  - Advanced interactions
186
200
 
187
- ## 🆘 Support & Resources
188
-
189
- - 📖 [Mappedin Developer Portal](https://developer.mappedin.com/)
190
- - 📋 [API Documentation](https://developer.mappedin.com/react-native/)
191
- - 💬 [Community Forum](https://community.mappedin.com/)
192
- - 🐛 [Issue Tracker](https://github.com/mappedin/react-native-sdk/issues)
193
-
194
201
  ## 📄 License
195
202
 
196
203
  See LICENSE.txt for license information.
197
204
 
198
205
  ---
199
-
200
- *Built with ❤️ by the Mappedin team*
201
-