Best workflow for user-driven Lat/Lng input in Cesium for Unreal using Blueprints?

Hi everyone,

I’m building an Unreal Engine application using Cesium for Unreal, and I’m implementing everything with Blueprints only (no custom C++ classes).

Instead of manually entering Latitude and Longitude in the editor, I want end users to choose any location themselves.

My ideal workflow is:

  1. The user searches for or selects a location (Google Maps, Google Earth, or another supported map).
  2. The application receives the Latitude and Longitude.
  3. Those coordinates are passed to Cesium at runtime.
  4. The CesiumGeoreference (or the appropriate Cesium component) automatically updates and loads the new location.

My goal is to achieve this entirely with Blueprints, without creating custom C++ classes if possible.

Specifically, I’d like to know:

  • What is the recommended way to let users select or search for a location?
  • Can CesiumGeoreference be updated entirely at runtime using Blueprints?
  • Is there an existing Blueprint workflow or example for changing the georeference dynamically?
  • If users enter a Google-style address (instead of coordinates), what is the recommended way to convert it into Latitude/Longitude before updating Cesium?

Any Blueprint-friendly examples or best practices would be greatly appreciated.

@adam4designss What you are probably looking for is the Query Cesium ion Geocoder blueprint function:

You use this function with a Cesium ion server along with an ion access token that has the geocode scope (check Cesium ion to see if your token has this scope granted). If you don’t provide a token, the default token from the provided server will be used, and if you don’t provide a server, the default server will be used.

You can select the Google or Bing geocoder. Which one you use should be influenced by what data you’re drawing from: if you’re using Google Photorealistic 3D Tiles, for example, you would want to use the Google geocoder; if you’re using the Bing Maps raster overlay, you should use the Bing geocoder. If the difference doesn’t matter to you, you can select the Default provider type.

If you are running this query after the user has submitted a search term, the Request Type should be Search. If you are running this query instead while the user is typing, to provide results as they write, you should use Autocomplete. This might provide less accurate results but in turn should be a bit quicker.

Lastly, you provide the string that the user has provided. This is the address or other term you want to look up.

It’s important to note that this is an async blueprint action. That means the first exec pin, the one at the top right of the function, will be called immediately after this function. It’s only when the geocoding query returns that the “On Geocode Request Complete” exec pin is called. It’s only when this pin is called that the response values of Success, Result, and Error will be populated.

If Success is false, Result will be blank and Error will contain an error message that describes what went wrong. If Success is true, Result will contain Features and Attributions. Features is an array of all of the results of your geocoding query, in order of relevance. You might want to just go for the first result, or you might want to show all of the results for the user to read. Each result has a point in Longitude Latitude Height, a rectangle (for some results, this is used - if you search up New York, NY, the rectangle will bound the whole city. For other results, only a single point is returned, so the rectangle will have no width or height), and a display name to show to the user.

The Attributions field is an array of credits that should be shown to the user along with the geocoding results. If Show On Screen is true, the attribution needs to be shown right along with the results. If Show On Screen is false, it can be listed on another screen you need to click through for (consult the attribution in Cesium for Unreal itself - in the bottom left, next to the Cesium ion logo, attributions with Show On Screen = true will be listed there on screen, and attributions with Show On Screen = false will be listed if you click on the “Data Attribution” link).

So, at this point you should have been able to query the geocoding API for a list of points related to a certain query. Now you want to change the position on the globe to one of these points. This is pretty simple!

You can change the origin of a georeference just by passing in the Longitude, Latitude, Height value to the “Set Origin Longitude Latitude Height” function:

But, if what you’re trying to do is move the camera to a certain position, you might instead want to use the Dynamic Pawn to fly to a given location:

thank you iwill used it thank youuuuuuuuuuuuuuuuuuuuu