rex_firebase_geofire
Plugin, ACE table, Discussion thread
Dependence: rex_firebase_apiV3
Dependence: rex_firebase_apiV3
Introduction
Realtime location queries with Firebase.
Realtime location queries with Firebase.
Usage
Sample capx
Sample capx
Set location of an item
Call "Action:Set location" to set a location ( Latitude , Longitude ) of an item or call "Action:Remove item" to remove an item. "Condition:On update" will be triggered while updating completed, otherwise "Condition:On update error" will be triggered.
Call "Action:Set location" to set a location ( Latitude , Longitude ) of an item or call "Action:Remove item" to remove an item. "Condition:On update" will be triggered while updating completed, otherwise "Condition:On update error" will be triggered.
Push an item
Get a random itemID by "Expression:GenerateKey" or "Expression:LastGeneratedKey" to push this item.
Get a random itemID by "Expression:GenerateKey" or "Expression:LastGeneratedKey" to push this item.
Remove item on disconnected
Call "Action:Remove item" to register a callback handler to remove an item while disconnected. Or call "Action:Cancel all handlers" to cancel handlers of this item.
Call "Action:Remove item" to register a callback handler to remove an item while disconnected. Or call "Action:Cancel all handlers" to cancel handlers of this item.
Monitor an area
Start monitor
Call "Action:Monitor at" to start monitor an area or change the monitor area with a center point( Latitude , Longitude ) and a radius in kilometers.
Get the monitor area by ( Expression:MonitorLatitude , Expression:MonitorLongitude ) and radius Expression:MonitorRadius.
A rex_firebase_geofire object only could monitor one area.
Call "Action:Monitor at" to start monitor an area or change the monitor area with a center point( Latitude , Longitude ) and a radius in kilometers.
Get the monitor area by ( Expression:MonitorLatitude , Expression:MonitorLongitude ) and radius Expression:MonitorRadius.
A rex_firebase_geofire object only could monitor one area.
Stop monitor
Call "Action:Stop" to stop current monitor.
Call "Action:Stop" to stop current monitor.
Items in monitor area
"Condition:On item entered", "Condition:On item exited", "Condition:On item moved" will be triggered while items are entered, exited, or moved.
Get triggered itemID by "Expression:LastItemID", location by ( Expression:LastLatitude , Expression:LastLongitude ) and distance between center point of monitor and location of triggered item by "Expression:LastDistance".
"Condition:On item entered", "Condition:On item exited", "Condition:On item moved" will be triggered while items are entered, exited, or moved.
Get triggered itemID by "Expression:LastItemID", location by ( Expression:LastLatitude , Expression:LastLongitude ) and distance between center point of monitor and location of triggered item by "Expression:LastDistance".
Retrieve items
Retrieve items in monitor area by "Condition:For each itemID", get itemID and location, distance by Expression:CurItemID , ( Expression:CurLatitude , Expression:CurLongitude ) , and Expression:CurDistance.
Retrieve items in monitor area by "Condition:For each itemID", get itemID and location, distance by Expression:CurItemID , ( Expression:CurLatitude , Expression:CurLongitude ) , and Expression:CurDistance.
Get location of an item
Follow these step to get location of an item back -
Follow these step to get location of an item back -
- Call "Action:Get item" to send a request to get an item from firebase server.
- "Condition:On get item" will be triggered when read item back, otherwise "Condition:On get item error" will be triggered.
- Check if the item is not null by "Condition:Item is not found" , which will return true if item is not null.
- then get location by ( Expression:LastLatitude , Expression:LastLongitude ) , itemID by "Expression:LastItemID".
Distance
Get distance between two points in kilometers by "Expression:Distance".
Get distance between two points in kilometers by "Expression:Distance".