• Professional advice
  • Order before 16.30 uur shipped today
  • Almost always available (+31 73 762 0 762)
  • Monday open late

Fibaro:calculateDistance command

fibaro:calculateDistance()

 

Actieon :

Calculates the distance between 2 geografical points

 

Uasge and parameters :

fibaro:calculateDistance(position1, position2)

  • position1: first location
  • position2: second location

A location is detemermend by latitude and longitude. Values are displayed in degress with a decimal point (no comma) and are seperated by a semicolom. Negative values are West and Soouth

Example, point 40°44’55″N, 73°59’11″W will be “40.7486;-73.9864″.

 

Return value:

Distance  in meters.

 

Programmeervoorbeeld :

local  eigenlocatie = fibaro:getValue(123, 'Location')   --123 is het ID van de gebruiker
local  voorbeeldlocatie = "51.6578349135172;18.6398273982745";

local result;
result = fibaro:calculateDistance(eigenlocatie,voorbeeldlocatie);
fibaro:debug(
'De afstand bedraagt' ..result.. " Meter");

 

 
Customer Service Phone

+31737620762
mon-fri: 10am-5pm and sat 10am-3pm

 
Adress

Gerstakker 16 5236 VG Empel Netherlands

Google maps