---
name: "openGeofenceMap"
mode: "kit"
deprecated: true
versionRequirements:
  - { name: "MapKit", version: "3.0.1" }
platform:
  - "iOS"
  - "Android"
async: true
title: "ty.map.openGeofenceMap"
---

## openGeofenceMap

> [DEPRECATED] **Deprecated**: openMap

> [VERSION] MapKit >= 3.0.1

> [PLATFORM] iOS, Android

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

### Description

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

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `geoTitle` | `string` | No | - | `3.9.1` | Geofence name |
| `longitude` | `number` | No | `0.0` | `3.9.1` | Longitude |
| `latitude` | `number` | No | `0.0` | `3.9.1` | Latitude |
| `radius` | `number` | No | `0` | `3.9.1` | Radius |
| `geofenceId` | `string` | No | - | `3.9.1` | id |
| `type` | `number` | No | `0` | `3.9.1` | Radius 0: Enter geofence 1: Leave geofence |
| `complete` | `() => void` | No | - | - | Callback invoked when the API call completes (runs on both success and failure) |
| `success` | `() => void` | No | - | - | Callback invoked on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Callback invoked on failed API call |

#### fail callback parameters

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

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

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Extended error code |
| `errorMsg` | `string` | Extended error message |


### Examples

```tsx
ty.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);
  },
});
```
