Use Widgets to Track Live Location

Use Widgets to Track Live Location

Requirement

Share the live location of a device and display it on a map that can be accessed from anywhere for tracking purposes.

Use Case

When an ambulance is on the run, it needs to reach the nearest hospital on time. To avoid any traffic, the ambulance driver shares the location of the vehicle with the police. The police officials track the live location of the vehicle on a map to help them navigate through the traffic and reach the nearest hospital at the earliest.

Steps to Follow

1. Create an application titled Tracking.

2. Create a form with the following details as your reference.

Form Name

Form Link Name

Field Type

Field Name

Field Link Name

Tracking

tracking

Address

Address

Address

Decimal

Longitude (with 7 Decimal Points )

Longitude

Decimal

Latitude (with 7 Decimal Points )

Latitude

The coordinates of the ambulance driver get auto-populated at an interval of 10 seconds in this Tracking form when they share their location.
This application has two widgets for the following purposes:
  1. For the ambulance drivers to share their location.
  1. For the police to track and view the ambulance driver's live location on GMaps.

3. The widgets can either be directly uploaded to Creator using the sample ZIP attachment at the end of this document or be created using terminal and then be uploaded to Creator.

Utilize Sample ZIP Attachment
i) Download the sample ZIP file attached at the end of this document. This contains all the primary and secondary files related to the Tracking app.
Note : If you're using the sample ZIP attachment to create your widgets, skip to step 4 after the download.
(OR)
Use Terminal to Create the Widgets
i) Install CLI to create a widget using terminal. After successful installation, navigate in the terminal to the file directory in which you want to create your project.
  1. cd Documents

ii) Run the following command in terminal to create a new project.
Note : All the commands in this page are directed towards working in a terminal. The same script can also be used in command prompt for Windows.
  1. zet init

iii) A list of Zoho Services will be displayed. Select Zoho Creator as the required service.


iv) Enter the Project Name as Tracking. The project folder will be created in the file directory you had navigated to. Here, the file directory folder is Documents .

v) Navigate to the widget.html file, as below. Rename it as enableTracking.html. Customize the script for this widget and insert it into the widget file. This widget creates a Share My Location button that the ambulance driver should use to enable the tracking of their live location.
Note : Alternately, you can copy and paste the sample script from the enableTracking.html file, which has been provided at the end of this document to create this widget instantly.  


vi) In terminal, enter the following commands to create one more widget file in your local storage. It will display GMaps for the police to view the location of the ambulance.
Note : The following commands execute their corresponding actions as mentioned below.

Command

Action

cd

Navigates to directory file

cd *file name*

Navigates to the file

mkdir *folder name*

Creates the folder

touch *file name*

Creates the file


  1. cd tracking/app
  2. mkdir GMaps
  3. cd Gmaps
  4. touch watchPosition.html

vii) Navigate to your local storage. Create and customize the secondary files (css and js) by writing your own scripts inside the app folder.
Note : Alternately, you can copy and paste the secondary folders inside the app folder.

viii) Customize the code for the watchPosition.html  (GMaps) and its equivalent js file.
 
Note : Alternately, you can copy and paste the code for the watchPosition.html (GMaps) and its equivalent js file. 

ix) Run the following command to validate and pack your project.

  1. cd
  2. cd Tracking
  3. zet validate
  4. zet pack
A ZIP file containing the primary and secondary files of your widget project will be created in the dist folder of your project directory.

 

4.  Navigate to the Settings of your Creator application. Click Widgets.


5. Click Create. The New Widget pane will pop up.

6. Fill in the corresponding fields with the details provided in the below table and create two widgets.
Note :
  1. The Index file is the primary file into which the widget's script is encoded. It links all the aspects of the widget together. Each index file is specific to its respective widget.
  2. The widget ZIP file is the file that encloses the primary and secondary files of all the widgets that are to be added. 

 

Name

Hosting

Widget File (Browse)

Index File

Widget 1

enableTracking

Internal

Tracking.zip

/enableTracking.html

Widget 2

GMaps

Internal

Tracking.zip

/GMaps/watchPosition.html


7. Create the following pages and add the respective widgets as mentioned below.

 

 

Page Name

Page Link Name

Widget

Description

1

Share Location

 

Share_Location

enableTracking

The Share Location page will contain the Share My Location button that will, when clicked, update the coordinates of the ambulance driver in the Tracking form.

2

GMaps - Live Tracking

 

GMaps_Live_Tracking

 

GMaps

The GMaps - Live Tracking page will contain the GMaps that will show the live moving location of the ambulance to the Police.


Points To Note

  1. You can choose to use GMaps or pick a different map altogether. We have attached the scripts for GMaps and OpenStreetMap at the end of this document for your reference.
  1. Add permissions under User Permissions for the ambulance drivers and the Police in the Settings of your application with the below images as reference.
  1. For Ambulance Drivers:

  2. For Police:

  1. Click Users under the MANAGE section of your Creator application and add users by specifying the Application Name , Role and Permissions  with the below images as reference.
    1. For Ambulance Drivers:

    2. For Police:

See How it Works



  1. Understand Widgets
  2. Add Widget to a Page
  3. Understand Pages
  4. Install Command Line Interface
  5. Understand Permissions
  6. Understand Users


    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION









                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Use widgets to create an online mobile store

                                                                                                                Requirement Display a card layout with each card containing mobile details like an image, company, model, and features. Any third party languages can also be used, provided the required dependencies like packages, CDN URLs etc. are included. Users ...
                                                                                                              • Zoho Creator - Widgets Kit

                                                                                                                Overview 1. What is this kit for? This kit is designed to help you create widgets in Zoho Creator using your existing Figma design. It contains step-by-step instructions and supported components for Creator widgets. If you're using this kit for the ...
                                                                                                              • Understand widgets

                                                                                                                This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. Widgets are used to extend the capabilities of your Zoho Creator application so that you could perform tasks that could not ...
                                                                                                              • Track software development lifecycle

                                                                                                                Requirement   Use Blueprints feature to track and manage the process of software development. Use Case   A software company uses blueprints to track and manage the software development lifecycle. Various blueprint actions are needed to mark the ...
                                                                                                              • FAQs: Capture Location - Location Data

                                                                                                                This page covers everything you need to know about managing geolocation data capture on your website forms, from informing users about location tracking to enabling and disabling the feature as per consent and privacy regulations.covers What is ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources