# 緯度、経度、特別な数式

*Skill Level: Intermediate*

## 開始前の準備

* [Google APIキーを生成](/ja/database/location/getting-your-google-api-key.md)したことを確認してください
* [locationプロパティタイプ](/ja/database/location/the-location-property-type.md)と[locationマジックテキスト](/ja/database/location/location-magic-text-and-formatting.md)について知っておく
* この機能を使用するには有料のAdaloプランが必要です
* アプリがユーザーの位置情報をリクエストするたびに、Googleプランに料金が発生する可能性があります

## 手順

{% tabs %}
{% tab title="シンプル" %}

#### フォーマット

緯度と経度を使用すると、入力フィールドに緯度と経度が表示される方法をエンドユーザーに表示する方法をフォーマットすることもできます。緯度と経度が入力されている場合は、赤いマジックテキストバブル内の**鉛筆アイコン**をクリックして、デフォルトのフォーマットは10進数です。

![](/files/UKZ9MK2aPgQODbPeQcAQ)

#### マップコンポーネントとの使用

マーカーアドレスを住所ではなく緯度と経度の値に設定することで、Mapsコンポーネントのパフォーマンスを大幅に向上させることができます。住所はすでに基本要素に分解されているため、マーカーの位置を地図上で決定するためにGoogleに2回送信する必要がないからです。以下のようにマーカーの値を**Location Latitude, Location Longitude**と設定します：

![](/files/clUjvFfYefSQRk4H40PJ)

#### 距離計算式の使用

緯度と経度データをカスタム数式と組み合わせて、新しい関数を使用して2点間の距離をキロメートルまたはマイルで計算することもできます。

* **マイルの計算 - MILES(latA, lonA, latB, lonB)**
* **キロメートルの計算 - KILOMETERS(latA, lonA, latB, lonB)**

![](/files/F8BfvGPzIwyWQ8S2QGMT)

以下のように、2点間の距離を計算する数式を設定できます：

![](/files/4YAHoHKpTPaU54EJKuU4)
{% endtab %}
{% endtabs %}

## もっと詳しく

* いつも通り、カスタム数式に接尾辞や接頭辞を追加して、マイル、キロメートルなどと表示させることができます
* 数式内の距離計算をさらに括弧で囲んで、異なる距離の単位（フィート、メートルなど）を取得するために乗算または除算することもできます
* [App Academyのコース](https://appacademy.adalo.com/course/geolocation-uber-airbnb)でLocationの使用について詳しく学ぶ

## ヘルプ

この記事に関する追加のヘルプが必要な場合は、いつでも[コミュニティフォーラム](https://forum.adalo.com/)で質問できます！投稿にこの記事へのリンクを貼り付けることも忘れないでください！


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.adalo.com/ja/database/location/latitude-longitude-and-special-formulas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
