@mappedin/react-native-sdk 5.0.2 → 5.1.0
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 +3 -57
- package/dist/commonjs/index.js +3628 -0
- package/dist/{index.js → esm/index.js} +204 -204
- package/dist/index.d.ts +29 -10
- package/package.json +4 -3
- package/dist/browser-FCICONUM.js +0 -1
- package/dist/chunk-MJIJTBP6.js +0 -1
package/README.md
CHANGED
|
@@ -120,10 +120,10 @@ Once the SVGs are prepared, they need to be wrapped in a `div` element which wil
|
|
|
120
120
|
import { MiMapView } from '@mappedin/react-native-sdk';
|
|
121
121
|
import type { MapViewStore } from '@mappedin/react-native-sdk';
|
|
122
122
|
|
|
123
|
-
// Imperative API
|
|
124
|
-
const mapView = React.useRef<MapViewStore>();
|
|
125
|
-
|
|
126
123
|
const App = () => {
|
|
124
|
+
// Imperative API
|
|
125
|
+
const mapView = React.useRef<MapViewStore>();
|
|
126
|
+
|
|
127
127
|
return (
|
|
128
128
|
<TouchableWithoutFeedback
|
|
129
129
|
style={{ flex: 1 }}
|
|
@@ -142,60 +142,6 @@ const App = () => {
|
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
## Search and Suggestions
|
|
146
|
-
|
|
147
|
-
```tsx
|
|
148
|
-
import { TextInput } from 'react-native';
|
|
149
|
-
import { MiMapView } from '@mappedin/react-native-sdk';
|
|
150
|
-
import type {
|
|
151
|
-
TBlueDotUpdate,
|
|
152
|
-
MapViewStore,
|
|
153
|
-
MappedinLocation,
|
|
154
|
-
MappedinNode,
|
|
155
|
-
} from '@mappedin/react-native-sdk';
|
|
156
|
-
|
|
157
|
-
// Imperative API
|
|
158
|
-
const mapView = React.useRef<MapViewStore>();
|
|
159
|
-
const [text, setText] = React.useState('');
|
|
160
|
-
|
|
161
|
-
const search = async (text) => {
|
|
162
|
-
const searchResults = await mapView.current.OfflineSearch.search(text);
|
|
163
|
-
// do something with search results
|
|
164
|
-
console.log(searchResults);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
const suggest = async (text) => {
|
|
169
|
-
const searchSuggestions = await mapView.current.OfflineSearch.suggest(text);
|
|
170
|
-
// do something with search suggestions
|
|
171
|
-
console.log(searchSuggestions);
|
|
172
|
-
};
|
|
173
|
-
if (text !== '') {
|
|
174
|
-
suggest(text);
|
|
175
|
-
}
|
|
176
|
-
}, [text]
|
|
177
|
-
|
|
178
|
-
const App = () => {
|
|
179
|
-
return (
|
|
180
|
-
<>
|
|
181
|
-
<MiMapView
|
|
182
|
-
style={{ flex: 1 }}
|
|
183
|
-
ref={mapView}
|
|
184
|
-
options={options}
|
|
185
|
-
/>
|
|
186
|
-
<View>
|
|
187
|
-
<TextInput
|
|
188
|
-
onChangeText={(text) => setText(text)}
|
|
189
|
-
value={text}
|
|
190
|
-
/>
|
|
191
|
-
<Button title="Search" onClick={() => search(setText)} />
|
|
192
|
-
</View>
|
|
193
|
-
</>
|
|
194
|
-
);
|
|
195
|
-
};
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
|
|
199
145
|
### [experimental] Fetching an offline Venue bundle
|
|
200
146
|
|
|
201
147
|
It is possible to download the venue bundle with all assets built in, which allows for caching/offline solutions.
|