Thunkable Docs
Build an AppDrag and Drop DocsSnap to Place DocsAcademy
Drag and Drop
Drag and Drop
  • What is Thunkable?
  • 🗺️Getting Started
    • Gen AI
      • Prompt Engineering
      • AI tools
      • AI Chatbot Helper
      • AI Template Generator
    • Getting Started Guide
    • Keyboard Shortcuts
    • Undo Redo
    • Thunkable Account
      • Account Management
    • Preview and Test your App
    • Versioning
    • Data Sources
      • Google Sheets Data Source
      • Airtable Data Source
      • Webflow Data Source
      • Local Table Data Source
    • Project Collaboration
      • Organizations
    • 🎓Sample Apps & Tutorials
      • Thunkable Community Forums
      • Sample Apps
      • Video Tutorials
        • Thunkable Live App
          • How to Test and Troubleshoot with Thunkable Live App
        • Data Source Tutorials
          • Connecting to Data Sources
            • Google Sheets
            • Local Table
          • Create Data in a Thunkable Data Source
          • Read Data in a Thunkable Data Source
          • Update Data in a Thunkable Data Source
          • Delete Data in a Thunkable Data Source
        • User Auth & Management
          • Firebase
            • User Sign-Up, Sign-In, and Auth
            • User Sign Out and Password Reset
          • Google
            • User Sign-Up, Sign-In, Sign-Out, and Auth
          • Apple
            • User Sign-Up, Sign-In, Sign-Out, and Auth
        • Projects
          • How to Save Versions of Your Thunkable Project
          • How to Copy and Customize Public or Sample Thunkable Projects
        • User Interface & Design
          • Screens
            • Save and Reuse Thunkable Screens
            • Change Thunkable Screens with a Button Click
            • Create Scrollable Screens in Your Thunkable App
          • Navigators
            • How to Use the Thunkable Stack Navigator
            • How to Use Thunkable Top and Bottom Tab Navigators
            • How to Use the Thunkable Drawer Navigator
            • Combine Figma Frames with Thunkable Navigators
          • Components
            • How to Use the Visibility Property to Create Modals in Thunkable
          • Data Visualization
            • Customize a Data Viewer
          • Text
            • Implement Text Input Validation
        • Alerts & Notifications
          • Display Alert Messages in Your Thunkable App
          • How to Create Three-Button Alert Messages
        • Files
          • Cloudinary
            • Store and Access Cloudinary Files in Your Thunkable App
        • Camera
          • How to Use the Device’s Camera
          • How to Use the Device’s Video Camera
          • Use the Device’s Camera as a QR or Barcode Scanner
        • Realtime Databases
          • Firebase
            • How to Read Data in a Firebase Realtime Database
            • How to Update Data in a Firebase Realtime Database
        • Advanced Blocks
          • Connect Your Thunkable App to a Web API
        • Thunkable Academy
          • Building Your First Thunkable App
            • Getting Started with Thunkable
            • How to Design a Thunkable App
            • How to Connect a Thunkable App to a Data Source
            • How to Make A Thunkable App Interactive with Blocks
          • Thunkable No Code App Creation Basics
            • Thunkable UI Components and App Features
            • Understanding Thunkable's Drag and Drop Block Builder
            • Design, Develop, Debug, and Deploy Your App
        • Hour of Code
          • 2021 - Build an Informational App
          • 2022 - Build a Scavenger Hunt App
          • 2023 - Build a Translator and Text-to-Speech App
        • App Building
          • How to Build a Translation App in Thunkable
          • How to Create an Image Recognition App with Thunkable
          • How to Create a Text-to-Speech App in Thunkable
  • 🎨App Design
    • User Interface (UI) Components
      • Basic Components
        • Button Component
        • Label Component
        • Rich Text Component
        • Image Component
        • Text Input Component
        • Layout Component
        • Group Component
      • Data Components
        • Simple List Component
        • Data Viewer Components
          • Data Viewer List Component
          • Data Viewer Grid Component
          • Custom Data Viewer
      • Input Components
        • Switch Component
        • Slider Component
        • Checkbox Component
        • Date Input Component
        • Time Input Component
      • Media Components
        • Animation Component
        • Video Component
        • Loading Icon Component
      • Embed Components
        • Web Viewer Component
        • Map Component
        • Canvas Component
        • PDF Reader Component
        • Rating Component
      • Modules
        • Introduction
        • User Guide
      • Generative AI
    • Screens
      • Save and Reuse Screens
      • Improve Thunkable Load Time
    • Navigators
      • Top Tab Navigator
      • Bottom Tab Navigator
      • Drawer Navigator
      • Stack Navigator
    • Figma Integration
  • 🛠️Blocks
    • Thunkable Blocks Overview
    • Core Blocks
      • Control Blocks
      • Logic Blocks
      • Math Blocks
      • Text Blocks
      • Lists Blocks
      • Color Blocks
      • Device Blocks
      • Objects Blocks
      • Variables Overview
        • Connect a Firebase Realtime Database
        • Variables Blocks
      • Functions Blocks
    • App Features Blocks
      • Speech Blocks
      • Sound Blocks
      • Share Blocks
      • Camera Blocks
      • Files Blocks
      • Sign In Blocks
        • User Sign Up, Sign In, and Authentication with Firebase
        • User Sign Up, Sign In, and Authentication with Google
        • User Sign Up, Sign In, and Authentication with Apple
      • Location Blocks
      • Push Notification Blocks
      • In-App Purchase Blocks (with RevenueCat)
      • Data Sources Blocks
      • Alerts Blocks
      • Timer Blocks
      • Sensors Blocks
        • Gyroscope
        • Magnetometer
        • Accelerometer
        • Location Sensor
      • Ads by AdMob
    • Advanced Blocks
      • Web APIs Blocks
        • CORS Policy
        • 🆓No Auth APIs
          • Update Data in a Data Source
          • CRUD Operations
          • Setting Headers
        • 📊Charting APIs
          • Create a chart template
          • Charting in Thunkable
      • Bluetooth Low Energy Blocks
      • OpenAI Services ChatGPT Integration Blocks
      • "Any Component" Blocks
      • JavaScript Web Bridge
  • ⚙️Settings
    • App Settings
      • Tablet View
    • Assets
    • Cloud Variable Viewer
    • Manage your Projects
      • My Projects Page
      • Thunkable Projects
      • Duplicate Project
      • Share Your App
      • Download Your App
        • Download Your App on iOS
        • Download Your App on Android
      • Add to Home Screen
      • Managing Project Storage
      • App Data Privacy
      • Delete Project
  • 📱Publishing
    • Overview
    • Publish to the Apple App Store
      • User Guide
      • Troubleshooting
      • Review Process
      • Tracking Usage Description
    • Publish to Google Play Store
      • User Guide
      • Troubleshooting
      • Review Process
    • Publish as a Web App
      • User Guide
      • Custom Domains
      • Troubleshooting
    • Testing
      • Testing on iOS via TestFlight
      • Testing on Android
    • Troubleshooting
      • Publishing Checklist
      • Generate Screenshots
  • 🎮Gaming
    • Gaming Overview
      • Canvas Label
      • Sprites
      • Sprite Gallery
    • Gaming Blocks
      • Events
      • Motion
      • Looks
      • Direction
      • Sensing
      • Add & Remove
      • Stage
  • 🗃️Additional Resources
    • Release Notes
      • Release Notes 2025
      • Release Notes 2024
      • Release Notes 2023
    • Troubleshooting
      • Can't Sign in to Thunkable?
      • FAQs
    • Minimum Requirements
    • Bugs and Product Feedback
    • App Services and Emulators
Powered by GitBook
On this page
  • Overview
  • Get current location Block
  • Set high accuracy location enabled
  • Location updates Blocks
  • Start location updates Block
  • Stop location updates Block
  • When location changes Block
  • Location updates active? Block
  • Web API Key
  • Coordinates and Addresses Blocks
  • Coordinates from address
  • Address from coordinates
  • Search Places Blocks
  • Regular Search Places Block
  • Advanced Search Places Block

Was this helpful?

Export as PDF
  1. Blocks
  2. App Features Blocks

Location Blocks

PreviousUser Sign Up, Sign In, and Authentication with AppleNextPush Notification Blocks

Last updated 5 months ago

Was this helpful?

Overview

In the world of mobile app development, location-based services have become a cornerstone of innovation, offering endless possibilities for creating engaging and practical applications. The Thunkable location blocks connect to the Google Maps APIs to create location-aware apps that enhance user experiences and improve engagement.

Get current location Block

The get current location returns a user's current location in latitude and longitude as well as a location object which includes additional properties like accuracy, altitude, speed and heading (or direction) which you can retrieve with theget property of object block.

Get current location block returns nothing when the "Allow Apps to Request to Track" in the iOS device's settings is turned off and the "Allow Tracking" is not activated on the app's settings.

Set high accuracy location enabled

Enables network provider that uses Google Play services to improve location accuracy and location-based services.

Theset high accuracy location enabled to block sets whether the high accuracy location is enabled or not.

Thehigh accuracy location enabled block returns true or false value for whether the high accuracy location is enabled.

Location updates Blocks

Location updates blocks allow you to easily monitor a user's location in real time. By starting and stopping location updates, you have full control over when tracking occurs, and you can trigger specific blocks when the user's location changes. You can also check the current status of location tracking to ensure it's active.

Start location updates Block

The start location updates block begins tracking the user's location.

Stop location updates Block

The stop location updates block ends tracking the user's location.

When location changes Block

When location tracking is active, the when location changes block will be triggered automatically whenever the user's location changes. The when location changes returns a user's current location in latitude and longitude as well as a location object which includes additional properties like accuracy, altitude, speed and heading (or direction) which you can retrieve with theget property of object block.

Location updates active? Block

The location updates active? block returns true or false value for whether the location updates is enabled.

Web API Key

Prior to publishing an app that incorporates the following Thunkable location blocks, you must first enter your personal Web API Key in your project's app settings. You can web preview and live-test your app with the Thunkable Live app using Thunkable's Web API Key, but you need to provide your own in order to publish your app.

To add your own Google Maps Web API Key to your Thunkable project:

  1. Click the gear icon on the left of your Thunkable project's Design tab to access your Project Settings.

  2. Scroll to the Google Map Settings section.

  3. Input your Web API Key into the corresponding field.

Coordinates and Addresses Blocks

Coordinates from address

Geocoding is the process of converting an address to a latitude-longitude pair. To access this functionality in Thunkable, you use the coordinates from address block in the Location drawer of blocks.

Outputs:

  • latitude

  • longitude

  • error

For Android, geocoding requires the device’s location services to be enabled.

Sample Block Combination

In the sample block combination below, when the Geocode button (btnGeocode) is clicked, the coordinates form address block will geocode the address the user has input in the text input (textAddress), and output the address’s latitude and longitude or an error if applicable. If there is an error, the label (labelError) will populate with the error output text. If there isn’t an error, the label (labelLocation) text will be populated by the address’s latitude and longitude, separated by a comma.

Possible Errors

Returned Value
Explanation

ZERO_RESULTS

The request was successful but returned no results.

INVALID_REQUEST

The request was not successful due to invalid parameters.

E_LOCATION_UNAUTHORIZED

Location services must be enabled.

Address from coordinates

For Android, reverse geocoding requires the device’s location services to be enabled.

Sample Block Combination

In the sample block combination below, when the Reverse Geocode button (btnReverse) is clicked, the address from coordinates block will engage in reverse geocoding using the latitude and longitude the user has input in the text inputs (textLat and textLng), and output the coordinate’s address or an error if applicable. If there is an error, the label (labelError) will populate with the error output text. If there isn’t an error, the label (labelAddress) text will be populated by the latitude and longitude’s address.

Note: The address from coordinates block in the image above is the advanced version of the block. To access this version:

  1. Drag and drop the block into your workspace.

  2. Right click on the block.

  3. Select Show advanced block.

Possible Errors

Returned Value
Explanation

ZERO_RESULTS

The request was successful but returned no results.

INVALID_REQUEST

The request was not successful due to invalid parameters.

E_LOCATION_UNAUTHORIZED

Location services must be enabled.

Search Places Blocks

Creators can utilize the search places blocks in their projects to allow their users to search Google Maps for places, businesses, and points of interest using text-based queries. For example, users can search for things such as “pizza restaurants in San Francisco” or “123 Main Street.”

The search places blocks leverage the Google Maps Text Search API, which allows you to send a search query as a string of text, and then Google Maps returns a list of places that match the query, along with relevant information like place names, addresses, and other details.

Regular Search Places Block

This block only requires the user’s query input. The API considers places based on the query's relevance.

Advanced Search Places Block

This block is built as an advanced-only block. It allows Creators to include additional inputs and provides additional outputs.

Inputs

Input
Description

latitude

The geographical coordinate (in decimal degrees format ranging from -90 to 90) that specifies the north-south position of a location on the Earth's surface, measured in degrees from the equator.

longitude

The geographical coordinate (in decimal degrees format ranging from -180 to 180) that specifies the east-west position of a location on the Earth's surface, measured in degrees from the Prime Meridian.

radius

A parameter that defines a circular area (in meters) around a specified latitude and longitude, within which the API should search for places based on the provided text query. If the radius is not specified, the API will consider places across a wider area based on the query's relevance.

language

page token

A token provided in the API response, which can be used to retrieve additional results from a previous query in situations where there are more results available than can be displayed on a single page. The page token overrides the other inputs. The other inputs will be ignored when the page token input is used.

Notes:

  • If neither latitude nor longitude values are provided, it will not pass the location parameter in the call. If only one of those values is provided, it will still pass the location parameter (but expect that the response will include an error or ignore it).

  • The location parameter may be overridden if the text query contains an explicit location, such as Market in Barcelona. Using quotes around the query may also influence the weight given to the location and radius.

Outputs

Output
Description

results

The array of places or points of interest that match the search query, providing information such as place names, addresses, ratings, and other details for each result. Consists of a list of objects converted from the JSON response. It will always include places (one or more) if the request was successful (status = OK). When the request returns nothing, the results will be null, and the error will contain the value "ZERO_RESULTS".

next_page_token

A token provided in the API response that can be used to retrieve additional results beyond the initial set when there are more results available than can be displayed on a single page. It enables paginated access to search results.

info_messages

Informational messages or notifications provided by the API that may convey details about the search request or any additional notes or cautions related to the results.

error

Follow these instructions to create your Web API Key: .

Additional error values are available here: .

Reverse Geocoding is the process of converting a latitude-longitude pair into a human-readable street address or . To access this functionality in Thunkable, you use the address from coordinates block, which is in the Location drawer of blocks.

Additional error values are available here: .

If a street address is unavailable, the block may return a .

An optional parameter that specifies the preferred language for the results, ensuring that place names, descriptions, and other information are presented in the user's preferred language. See here for a list of supported languages: .

An indication that an error has occurred during the API request, typically accompanied by an error code and message, providing information about what went wrong. See here for a list of possible errors: .

Have feedback on this doc? Please take a moment to share your feedback here: . Your valuable insights will help us improve and better serve you in the future.

🛠️
Creating API keys
Google Maps Platform Status Codes
Plus Code
Google Maps Platform Status Codes
Plus Code
Thunkable Docs Feedback
Google Maps Platform - Supported Languages
Google Maps Text Search API - Places Search Status