Interface IGeocoder
Turns a place name into map positions, and a position back into a place name; implement this to search with your own provider.
public interface IGeocoder : IDisposable
- Inherited Members
Remarks
Every member is called from the Unity main thread. The idiom is polling, not callbacks: call Search(string) or SearchReverse(LatLon), then call TryGetResults(List<GeocodeResult>) once per frame until it returns true.
A new search cancels any search still in flight, and only the newest one ever reports results.
Properties
SearchPending
True while a search has been started and has not completed.
bool SearchPending { get; }
Property Value
Methods
Search(string)
Starts a search for a place name; returns immediately.
void Search(string query)
Parameters
querystringFree-form place name typed by a user.
SearchReverse(LatLon)
Starts a search for the place at a position; returns immediately.
void SearchReverse(LatLon position)
Parameters
positionLatLonPosition in degrees WGS84.
TryGetResults(List<GeocodeResult>)
Takes the results of a completed search.
bool TryGetResults(List<GeocodeResult> results)
Parameters
resultsList<GeocodeResult>Filled with the results, best first, and left empty when the search found nothing or failed.
Returns
- bool
True exactly once per completed search, false while one is still running or when none was started.