Skip to content

Conversation

azrogers
Copy link
Contributor

This PR implements the Cesium ion geocoder in Unity. The geocoder can be used like so:

 void Start()
 {
     var geocoder = new CesiumIonGeocoder();
     StartCoroutine(GeocodeCoroutine(geocoder));
 }

 IEnumerator GeocodeCoroutine(CesiumIonGeocoder geocoder)
 {
     var task = geocoder.Geocode(
          CesiumIonServer.defaultServer, 
          "<token here>", 
          CesiumIonGeocoderProviderType.Google, 
          CesiumIonGeocoderRequestType.Search, 
          "<search query here>");
     yield return new WaitForTask(task);
     Debug.Log(task.Result.features);
 }

This is in a draft PR for the moment as it is not fully working yet. Some things also left to work out:

  • error handling when creating a connection
  • returning bounding boxes
  • using default token when no token is provided to the method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant