Select to view content in your preferred language

About map initialization

493
0
07-25-2023 04:07 AM
jianghan8098
Emerging Contributor

The following file is your sample code SampleAPIMapCreator, used to initialize the map, but the current problem is that the initialization speed is a little slow, almost need to run 3s or so, you can call the following two methods to convert latitude and longitude。

public static Vector3 GetUnityPosFromLatlon(ArcGISPoint latLon)
{
var cartesianPosition = arcGISMapComponent.View.GeographicToWorld(latLon);

return hPRoot.TransformPoint(cartesianPosition).ToVector3();

}

public static ArcGISPoint GetLatLonFromUnityPos(Vector3 vec)
{

var worldPosition = hPRoot.InverseTransformPoint(vec.ToDouble3());

return arcGISMapComponent.View.WorldToGeographic(worldPosition);

}

but the old version of Arcgis, the initialization speed is particularly fast。The older version of the initialization script was KDArcGISManager。look forward to your answer

0 Kudos
0 Replies