Allows to watch a dynamic geographic point and trigger an event when it enters or leaves a zone. Zones can be defined as unique or list of custom polygons or radius around a point. Highly customizable and complete documentation.
Examples:
How to setup
In this section, you will find all the required information to set up the plugin. We strongly recommend following this if you just purchased the plugin.
Getting started
Geofencing inside a geographic point radius
Set the Geofencing type to “Distance”
First, define the geographic point or location that you will watch.
The plugin will trigger an event when this geographic point enter or leaves the point radius.
Note: you can enter either a Bubble geographic address or raw coordinates
Then, setup the trigger point.
Note: you can enter either a Bubble geographic address or raw coordinates. You can also set a list of trigger points.
Finally, define the trigger radius and the measurement unit.
✅
You’re all set, whenever WATCH POINT enters or leaves TRIGGER POINT(S) in a radius of TRIGGER RADIUS, a Bubble event will be trigger and the “Is inside” state of the plugin element will change.
Geofencing inside a polygon
Set the Geofencing type to “Polygon”
First, define the geographic point or location that you will watch.
The plugin will trigger an event when this geographic point enter or leaves the point radius.
Note: you can enter either a Bubble geographic address or raw coordinates
Then, to setup the trigger polygon, enter all the polygon points. You should respect the following formatting:
javascript
long,lat,long,lat,long,lat,long,lat
Note: You can also set a list of polygons. See how to.
If you want to use a polygon list, you should include a semi-colon to separate each polygon, like this:
You’re all set, whenever WATCH POINT enters or leaves the POLYGON(S), a Bubble event will be trigger and the “Is inside” state of the plugin element will change.
Adding a unique ID list
If you want to add a list of unique IDs of the trigger polygons or geographic points in order to retrieve which trigger is entered, you can set the “Unique ID list” field.
This list must be in the same order as the trigger polygons or geographic points order.
⚠️
Did you notice? When using a Bubble list we use the :format as text suffix.
That’s because the plugin expects you to enter a comma-separated list, like this:
id1,id2,id3,id4
Where Bubble usually formats list as comma-separated with space:
id1, id2, id3, id4
In order to prevent this issue, simply use the following pattern in your :format as text suffix.
Plugin Element Properties
Distance calculator
Fields:
Title
Description
Type
Address 1
First Bubble geographic address
Geographic Address (optional)
Address 2
Second Bubble geographic address
Geographic Address (optional)
Unit
Available options: Miles, Kilometers, Nautical miles
Dropdown
➡️ Use raw coordinates
Check this setting if you wish to manually enter latitude and
longitude of the distance to calculate. Then fill the fields below.
Checkbox (yes/no)
Address 1 - Latitude
First address Latitude
Number (optional)
Address 1 - Longitude
First address Longitude
Number (optional)
Address 2 - Latitude
Second address Latitude
Number (optional)
Address 2 - Longitude
Second address Longitude
Number (optional)
Exposed states
Title
Description
Type
Calculated distance
distance in chosen units
Number
Geofence
Fields:
Title
Description
Type
⚙️SETTINGS
Geofencing type
Choose the geofencing type, can be triggered inside a polygon or
based on the distance from a geographic point. Available options:
Polygon, Distance
Dropdown
📍WATCH POINT
Location to watch
This field refers to the geographic point you want to watch /
monitor. This must be a Bubble geographic address type.
Geographic Address (optional)
OR use raw coordinates
Check this box if you wish to use raw coordinates instead of the
geographic address type above. Useful to avoid Google API calls. If
enable, latitude and longitude fields below must be filled.
Checkbox (yes/no)
Location longitude
Raw coordinates
Number (optional)
Location latitute
Raw coordinates
Number (optional)
🕸️ POLYGON SETTINGS
REQUIRED IF GEOFENCE TYPE IS “POLYGON”
Polygon(s) data
The geoJSON of the polygon, which should be a comma-separated list
of geographic points formatted as “long,lat,long,lat”. If you want to
enter multiple polygons, separate them using a semi-colon as
“long,lat,long,lat;long,lat,long,lat”
Text (optional)
📏 DISTANCE SETTINGS
REQUIRED IF GEOFENCE TYPE IS “DISTANCE”
Trigger point
Geographic address
Geographic Address (optional)
OR Trigger point list
List of geographics addresses
Geographic Address (optional)
OR use raw coordinates
Check this box if you wish to use raw coordinates instead of the
geographic address types above. Useful to avoid Google API calls. If
enable, latitude and longitude fields below must be filled.
Checkbox (yes/no)
Location(s) longitude
If you’re using a list of raw coordinates, then use a
comma-separated list of longitude. Must be in the exact same order and
length as the latitude list.
Number (optional)
Location(s) latitute
If you’re using a list of raw coordinates, then use a
comma-separated list of latitude. Must be in the exact same order and
length as the longitude list.
Number (optional)
Trigger radius
Trigger radius in which the watch point is considered “inside”.
Number (optional)
Trigger radius list
Optional, if every trigger location has a different trigger radius,
enter the radius list here in the exact same order as the location list
above. Should be comma separated and using points for the decimal.
Text (optional)
Unit
Used for the trigger radius and for the exposed calculated distance.
Available options: Miles, Kilometers, Nautical miles
Dropdown
🟠ADVANCED SETTINGS 🟠
Unique ID list
If you are using a list of location triggers or a list of polygons,
you can define a unique ID to each of them in order to retrieve later in
which zone you’re inside. Must be in the exact same order as the
location or polygon lists above. Should be comma separated.
Text (optional)
Ignore first event ?
If enable, the plugin won’t trigger any Bubble event when the plugin
is loaded for the first time. Available options: No, Yes, Only if
inside, Only if outside
Dropdown
❗
When using the coordinates of the current location of other plugins (for example, Mapbox), for correct operation of the states, it is necessary to use the "Location to watch" field and the "Location longitude", "Location latitude" coordinate fields together.
Exposed states
Title
Description
Type
📏Distance from trigger
Distance to the point
Number
☑️Is inside ?
Yes when coordinates inside the poligone
Checkbox (yes/no)
Trigger unique ID
ID from “Unique ID list” field that was triggered
Text
Element Events
Title
Description
watch point entered trigger zone
Triggers watch point entered trigger zone
watch point left trigger zone
Triggers watch point left trigger zone
watch point status changed
Triggers when the watch point status changed
Plugin Actions
🐝 Calculate distance between positions
Title
Description
Type
Address 1
First Bubble geographic address
Geographic Address (optional)
Address 2
Second Bubble geographic address
Geographic Address (optional)
Unit
Available options: Miles, Kilometers, Nautical miles
Dropdown
➡️ Use raw coordinates
Check this setting if you wish to manually enter latitude and
longitude of the distance to calculate. Then fill the fields below.
Checkbox (yes/no)
Address 1 - Latitude
First address Latitude
Number (optional)
Address 1 - Longitude
First address Longitude
Number (optional)
Address 2 - Latitude
Second address Latitude
Number (optional)
Address 2 - Longitude
Second address Longitude
Number (optional)
Return Values:
Title
Description
Type
Distance
Distance in chosen units
Number
Changelogs
Update: 20.05.24 - Version 1.6.0
Added support for multi polygon json
Update: 13.05.24 - Version 1.5.0
Added possibility to enter JSON into the Polygon(s) data field