How to achieve overlay markers within unity from latitude/longitude data?. mostly positioning them like in the above image.
Assuming you know their longitude/latitude/height, the easiest thing to do is to add a CesiumGlobeAnchor component to whatever GameObject you’re using to render them, and setting the longitude/latitude/height properties on it.
Hey there, I’m currently attempting something similar, were you able to get yours working?
yes. Just follow what Kevin said
@Kevin_Ring Following along this same premise, I have the GlobeAnchors set, but I want to be able to dynamically add these game objects by clicking on the map. What do I need to do to grab lat/lon from the map itself when I click on it?
Once you have your Unity position, you can use CesiumGeoreference.TransformUnityPositionToEarthCenteredEarthFixed
and CesiumWgs84Ellipsoid.EarthCenteredEarthFixedToLongitudeLatitudeHeight
to get the position in longitude, latitude, height.
You’ll have to include the Unity.Mathematics
package to be able to use double3
.
Thanks @janine , one more follow up if I may?
Now that I have my overlay marker added as GlobeAnchors, how can I retrieve that lat/lon data from them?
I want to be able to click on the overlay markers that are being added-- most will be added via a database, and see the data associated with them.
Looking in the Metadata example, I’m not seeing exactly how I need to go about setting this up on my own.