Geofencing¶
Geofencing is a location-based technology that allows developers to create virtual boundaries around real-world geographic locations. These virtual boundaries can then be used to trigger location-based events, such as notifications, alerts, or actions.
To implement geofencing, developers typically use geofencing maps APIs (Application Programming Interfaces). These APIs provide access to maps and location data, as well as tools for defining geofences, tracking user location, and triggering events.
URL¶
Method¶
POST
Parameters¶
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
apikey | string | yes | none | API provided by VIETMAP for customer's account. |
Example¶
Body:
{
"geometryCenters":
[
{
"id": "1",
"long": 105.7487405,
"lat": 9.8644254
},
{
"id": "2",
"long": 105.7491342,
"lat": 9.8642686
},
{
"id": "3",
"long": 105.7489267,
"lat": 9.8645398
}
],
"radius": 15,
"long": 105.7488398,
"lat": 9.8643837
}
Request body description¶
Parameter | Type | Description |
---|---|---|
geometryCenters | array | An array containing information about the geometry centers of interest. Each element includes the ID, longitude (long), and latitude (lat) of a center point. |
geometryCenters.id | string | The identifier of the geometry center. |
geometryCenters.long | number | The longitude coordinate of the geometry center. |
geometryCenters.lat | number | The latitude coordinate of the geometry center. |
radius | number | The radius (in meters) used for defining the area around the central point. |
long | number | The longitude coordinate of the central point. |
lat | number | The latitude coordinate of the central point. |
JSON Output¶
{
"code": null,
"message": null,
"data": [
{
"id": "1",
"inside": true
},
{
"id": "2",
"inside": false
},
{
"id": "3",
"inside": false
}
]
}
//id: index of the checkpoints, areas to be inspected
//inside: true (inside the area)/ false (outside the area)
Body response description¶
Field | Type | Description |
---|---|---|
code | null | Indicates the status code of the response, if any. |
message | null | Any messages associated with the response, if present. |
data | array | An array containing information about each checkpoint or area. |
data.id | string | The identifier of the checkpoint or area. |
data.inside | boolean | Indicates whether the checkpoint or area is inside (true ) or outside (false ) the designated area. |