1.0.1 • Published 2 years ago

@arepa/launch-navigator v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

launch-navigator

@arepa/launch-navigator

npm install @arepa/launch-navigator

Usage

API

Methods

MethodDescription
checkInstalledApp(packageName: string or SupportedApps)Checks if the app is installed on Android (com.id.pack) or iOS (urlscheme://). You can also use SupportedApps, which returns a boolean.
openGoogleMaps(OpcionesGoogleMaps)Opens the Google Maps app. Returns a Promise.
openWaze(OpcionesWaze)Opens the Waze app. Returns a Promise.
openBaidumap(OpcionesBaidumap)Opens the BaiduMap app. Returns a Promise.
openAppleMaps(OpcionesAppleMaps)Opens the Apple Maps app. Returns a Promise.
SupportedApps
Google MapAndroid e iOS
WazeAndroid e iOS
Apple MapsiOS

Response

PropertyDescription
errorBoolean. Indicates whether an error occurred or not.
errorTextString error message.

TransporteGoogleMaps

PropertyDescription
DRIVING
WALKING
BICYCLING
TRANSIT

Options

OpcionesGoogleMaps

PropertyTypeDescription
daddrstring or ArrayDestination address
saddr?string or ArrayStarting address
modoTransporteTransporteGoogleMapsTransportation type
tipoMapaTURN_BY_TURN or MAPSIf it's TURN_BY_TURN on Android, it will start navigation automatically
avoid?stringSets characteristics the route should try to avoid. Values "t", "h", or "f"

OpcionesWaze

PropertyTypeDescription
destinostring or ArrayDestination address
navigatestringValues yes or `no, starts or doesn't start navigation in the Waze app

OpcionesAppleMaps

PropertyTypeDescrDescriptionipción
tipostringValues s, k, h, or r. Map type transit, standard, etc.
daddrstring or ArrayDestination address
saddrstring or ArrayStarting address
dirflgstringValues d, w, or r. Transportation mode

Ejemplos

Verificar si la app esta instalada

checkAppInstalada(AppsSoportadas.WAZE o AppsSoportadas.APPLE_MAPS o AppsSoportadas.BAIDUMAP o AppsSoportadas.GOOGLE_MAPS): boolean

Google Maps

openGoogleMaps({
  daddr:"Maracay aragua venezuela",
  modoTransporte:TransporteGoogleMaps.DRIVING,
  tipoMapa:"TURN_BY_TURN",
  saddr:"Villa de cura aragua venezuela",
  avoid:"fth"
 }).then((res)=>{
  //Ok
 }).catch((err)=>{
  //Error
 })  

Waze

openWaze({
  destino:"tia el recreo quito pichincha ecuador",
  navigate:"yes"
}).then((res) => {
  console.log(res);
}).catch((err) => {
  console.log(err);
})

Apple Maps solo para iOS

openAppleMaps({
  daddr:"Tia el recreo quito ecuador",
  dirflg:"d",
  tipo:"s",
  saddr:"Maracay aragua veneuzela",
}).then((res)=>{
  console.log(res);
}).catch((err)=>{
  console.log(err);
})
1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago