Geofencing API

Geofencing means drawing a virtual boundary around a real-world place and reacting when a device or vehicle crosses it. The VIETMAP Geofencing API lets you define those boundaries anywhere in Vietnam and check positions against them, so entering or leaving a zone can trigger a notification, an alert, or a step in your workflow.
What you can build with it
| Use case |
What the geofence does |
| Proof of delivery |
Confirm the vehicle actually reached the customer address before the driver marks the order delivered. |
| Fleet compliance |
Alert when a truck leaves its permitted operating zone or enters a restricted district. |
| Automatic trip records |
Start and stop a trip when a vehicle leaves and returns to the depot, without the driver touching anything. |
| Site attendance |
Record staff arriving at and leaving a construction site or branch. |
| Proximity marketing |
Notify a customer when they are near one of your stores. |
| Asset protection |
Raise an alarm the moment equipment moves outside the yard it belongs to. |
Geofence vs. isochrone
A geofence is a boundary you define and monitor for crossings. An isochrone is a boundary VIETMAP computes — the area reachable within a given travel time. They pair naturally: compute an isochrone to decide what a sensible serving area looks like, then register that area as a geofence and monitor it.
URL
https://maps.vietmap.vn/api/geofencing?apikey={your-apiKey}
Method
POST
Parameters
| Parameter |
Type |
Required |
Default |
Description |
| apikey |
string |
yes |
none |
API key provided by VIETMAP for your account. Register here |
Example
URL:
https://maps.vietmap.vn/api/geofencing?apikey=”YOUR APIKEY”
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. |