---
name: "openGeofenceMap"
mode: "kit"
deprecated: true
versionRequirements:
  - { name: "MapKit", version: "3.0.1" }
  - { name: "@ray-js/ray", version: "1.2.10" }
platform:
  - "iOS"
  - "Android"
async: true
title: "map.openGeofenceMap"
---

## openGeofenceMap

> [DEPRECATED] **Deprecated**: openMap

> [VERSION] MapKit >= 3.0.1 | @ray-js/ray >= 1.2.10

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Method signature

```typescript
openGeofenceMap(params: Object)
```

### Description

Open the geofence map page to obtain geofence information (create or edit a geofence). Permission: [scope.location]

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `geoTitle` | `string` | No | - | Geofence name |
| `longitude` | `number` | No | `0.0` | Longitude |
| `latitude` | `number` | No | `0.0` | Latitude |
| `radius` | `number` | No | `0` | Radius |
| `geofenceId` | `string` | No | - | id |
| `type` | `number` | No | `0` | Radius 0: enter geofence 1: leave geofence |
| `complete` | `() => void` | No | - | Completion callback (executed on both success and failure) |
| `success` | `() => void` | No | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | Failure callback |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Examples

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

map.openGeofenceMap({
  geoTitle: "xx",
  longitude: 116.39747,
  latitude: 39.908823,
  radius: 200,
  geofenceId: "xx",
  type: 0,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
