🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

@local-logic/lat-client

Package Overview
Dependencies
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@local-logic/lat-client

The `@local-logic/lat-client` package allows you to download or preview Local Logic Logic Location Assessment Tool (LAT).

unpublished
npmnpm
Version
2.2.1
Version published
Maintainers
5
Created
Source

Local Logic Location Assessment Tool (LAT)

The @local-logic/lat-client package allows you to download or preview Local Logic Logic Location Assessment Tool (LAT).

Getting started

Installation

First, install with yarn, pnpm, or npm:

yarn add @local-logic/lat-client
pnpm add @local-logic/lat-client
npm i --save @local-logic/lat-client

Usage

You can now import LatClient:

import LatClient from "@local-logic/lat-client";

const latClient = LatClient(
  "<API_KEY>", {
    lat: 45.528130, // Your address latitude
    lng: -73.598100, // Your address longitude
    addressLabel: "5605 Av. de Gaspé #304, Montreal, Quebec H2T 2A4",
  });

Now you can use the .download() or .open() methods.

ℹ️ You should only call these methods within an 'click' event handler. Otherwise, these events may be treated as popup events by the browser.

Open Example

const button = document.createElement("button");
button.innerText = "Open Preview";
button.onclick = () => latClient.open();
document.body.appendChild(button);

Download Example

const downloadButton = document.createElement("button");
downloadButton.innerText = "Download Report";
downloadButton.onclick = async () => {
  downloadButton.innerText = "Downloading...";
  await latClient.download();
  downloadButton.innerText = "Download Report";
};
document.body.appendChild(downloadButton);

React Example

import { useState } from "react";
import LatClient from "@local-logic/lat-client";

const latClient = LatClient(
  "<API_KEY>",
  {
    lat: 45.52813, // Your address latitude
    lng: -73.5981, // Your address longitude
    addressLabel: "5605 Av. de Gaspé #304, Montreal, Quebec H2T 2A4"
  }
);

export default function App() {
  const [downloading, setDownloading] = useState(false);

  return (
    <button
      onClick={async () => {
        setDownloading(true);
        latClient.download();
        setDownloading(false);
      }}
      disabled={downloading}
    >
      {downloading ? "Downloading..." : "Download"}
    </button>
  );
}

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts