# Search for points of interest in Geospatial Creator for Unity

Geospatial Creator uses latitude and longitude coordinates to preview
photorealistic 3D tiles. You can use a text search to search for real-world
locations and use its location in the preview using the Google Places API.

This document assumes you are familiar with Geospatial Creator for Unity. If you
are new to Geospatial Creator, check out our [Getting
Started](https://developers.google.com/ar/geospatialcreator/unity/quickstart) guide before continuing.

## Configure your Places API Key

Geospatial Creator Search is powered by the [Google Places
API](https://developers.google.com/maps/documentation/places/web-service/overview).
This service can convert place names like Tokyo, San Francisco, or addresses
like 10 Downing Street, SW1A 2AA, into geographic latitude and longitude
coordinates. These coordinates can be used to place objects or move the origin
of your AR scene to a specific location.

You need to configure your API key to use the Places API. The API key must be
the same one you use for the Map Tiles API. You can check this key on the
Inspector panel for your Geospatial Creator Origin.

To set up the API key for search, do the following:

1. To enable the Places API, see the [Places API page](https://console.cloud.google.com/apis/library/places-backend.googleapis.com) in your Google Cloud Console.
2. To configure your existing API key to use the Places API, visit the [Credentials page](https://console.cloud.google.com/apis/credentials) in your Google Cloud Console.

If you don't see your existing Map Tiles API key, make sure you are looking at
the correct Google Cloud Project.

## Change the Origin location using Search

After you have configured your API key, you can use Search to change your
Geospatial Creator Origin. Highlight your Geospatial Creator Origin in the Scene
Hierarchy, and then click the "Search for Location" button on the Inspector
panel:

![alt_text](https://developers.google.com/static/ar/geospatialcreator/unity/search-origin-inspector.png "Geospatial Origin inspector pane with Search button")

If you don't have an existing origin in your scene, you can add one from the
**GameObjects \> XR** menu.

When the Search dialog opens, enter your search term into the "Search Place"
box and press Enter. The "Places" drop down populates with relevant
results. For example, if you type in "Google Mountain View", the list includes
addresses for Google Headquarters in Mountain View, CA:

![alt_text](https://developers.google.com/static/ar/geospatialcreator/unity/search-dialog.png "Search dialog window")

Select the most relevant result. The Scene View camera will move to a position
above the selected location. Click "Apply to Objects" to assign the latitude and
longitude of this search result to your Origin.

Remember, the Origin is the reference point that determines where your
Geospatial Creator Anchors are in Unity world coordinates. When you move the
Origin, the latitude and longitude of all anchors associated with that origin
are updated to maintain their relative position to the Origin in Unity world
coordinates. This is useful if you want a specific arrangement of anchors in the
vicinity of an origin.

## Change Anchor locations using Search

You can also use the Search feature to change the location of a Geospatial
Anchor, independently of the Origin. Similar to using Search for an Origin,
select the anchor in the Scene Hierarchy and click the "Search for Location"
button. This dialog is nearly identical to the origin search. Type your search
term in the "Search Place" box, and press Enter. You can now reassign the
Anchor latitude and longitude using the results in the "Places" drop down list.
Note that you may need to manually adjust the altitude of the anchor.

You can also multi-select Anchors in the Scene Hierarchy, and then use the
Search feature to assign multiple anchors to a search result simultaneously. The
"Selected Objects" list in the Search Dialog includes the names of all anchors
to be moved.

## Known Shortcomings / Issues

- Separate keys for the Places API and Map Tiles API are not supported at this time; you must use the same key for each.
- A Geospatial Creator Origin must have a Cesium Georeference component for Search to work.