Skip to content

jonastreub/LocationManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

LocationManager

Useful location data for Framer prototypes. Find out where the user is located and get distance and heading to other locations.

Note: Location data is not available in Framer Studio so use a browser window for testing.

Example

Properties

  • enabled <bool>
  • latitude <number> readonly (90 to -90 degrees)
  • longitude <number> readonly (180 to -180 degrees)
  • errorMessage <string or null> readonly
# Include the LocationManager
{LocationManager} = require "LocationManager"

locManager = new LocationManager

Functions

  • LocationManager.available() returns <bool> (whether current device supports location data)
  • distanceTo(destinationCoordinates) returns <number> (meters)
  • headingTo(destinationCoordinates) returns <number> (degrees)
NY =
	latitude: 40.748817
	longitude: -73.985428

distanceToNY = locManager.distanceTo(NY)
headingToNY = locManager.headingTo(NY)

Events

  • onLocationChange (data {latitude, longitude})
  • onLocationError (message <string>)
locManager.onLocationChange (data) ->
	latitude = data.latitude
	longitude = data.longitude

locManager.onLocationError (message) ->
	print message

About

A Framer module to make working with locations easy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published