openMapAppLocation(params: Object)

Requires:
MapKit≥2.1.0@ray-js/ray≥1.2.10
Platforms:
iOSAndroid
import { map } from '@ray-js/ray';

const { openMapAppLocation } = map;

// Promise usage
try {
  const res = await openMapAppLocation({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

View location in a third-party map

Parameters

PropertyTypeRequiredDescription
latitudenumberYesLatitude, range -90 to 90; negative values indicate south
longitudenumberYesLongitude, range -180 to 180; negative values indicate west
namestringYesLocation name
addressstringYesDetailed address
mapTypestringYesMap type. Currently supported: BMK: Baidu Maps, MA: Amap, TENCENT: Tencent Maps, Google: Google Maps
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { map } from '@ray-js/ray'

map.openMapAppLocation({
  latitude: 39.908823,
  longitude: 116.39747,
  name: "xx",
  address: "xx",
  mapType: "MA",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});