You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
address:'1600 Pennsylvania Avenue NW, Washington, DC 20500', // Required if replacing latitude and longitude
275
+
app:'comgooglemaps', // optionally specify specific app to use
276
+
});
277
+
```
278
+
268
279
Notes:
269
280
270
281
- The `sourceLatitude` / `sourceLongitude` options only work if you specify both. Currently supports all apps except Waze.
271
282
-`directionsMode` works on google-maps, apple-maps and sygic (on apple-maps, `bike` mode will not work, while on sygic, only `walk` and `car` will work). Without setting it, the app will decide based on its own settings.
272
283
- If you set `directionsMode` but do not set `sourceLatitude` and `sourceLongitude`, google-maps and apple-maps will still enter directions mode, and use the current location as starting point.
273
-
-
284
+
- If you want to query an address instead of passing the `latitude` and `longitude` fields, you can do this by leaving those fields off and provide a full address to be queried with the `address` field. Just be aware that not all applications support this.
274
285
275
286
### Or
276
287
@@ -296,6 +307,7 @@ const Demo = () => {
296
307
const result =awaitgetApps({
297
308
latitude: 38.8976763,
298
309
longitude: -77.0387185,
310
+
address: '1600 Pennsylvania Avenue NW, Washington, DC 20500', // optional
299
311
title: 'The White House', // optional
300
312
googleForceLatLon: false, // optionally force GoogleMaps to use the latlon for the query instead of the title
301
313
alwaysIncludeGoogle: true, // optional, true will always add Google Maps to iOS and open in Safari, even if app is not installed (default: false)
Copy file name to clipboardExpand all lines: src/type.ts
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -45,8 +45,11 @@ export type GetAppsResponse = {
45
45
};
46
46
47
47
exportinterfaceShowLocationProps{
48
-
latitude: number|string;
49
-
longitude: number|string;
48
+
latitude?: number|string;
49
+
longitude?: number|string;
50
+
/** optionally you can enter a full address that will be queried against the map app's API and return the initial results if not the actual matched result. */
51
+
/** latitude and longitude will be ignored if the address field is set */
0 commit comments