Skip to content

Can you tell me why it's taking so long to initialize #82

@JhonJHUtd

Description

@JhonJHUtd

The initialization of the map is too slow, the initialization is successful only about 4s, and before the initialization is successful, the longitude and latitude conversion algorithm will be called abnormally

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

// Check for NaN values
if (float.IsNaN(result.x) || float.IsNaN(result.y) || float.IsNaN(result.z))
{
Debug.LogWarning("GetUnityPosFromLatlon returned NaN. Returning default value.");
return Vector3.zero; // Return a default value (0, 0, 0) in case of NaN
}

return result; // Return the calculated result

}

public static ArcGISPoint GetLatLonFromUnityPos(Vector3 vec)
{

var worldPosition = hPRoot.InverseTransformPoint(vec.ToDouble3());
ArcGISPoint result = arcGISMapComponent.View.WorldToGeographic(worldPosition);
if (double.IsNaN(result.X) || double.IsNaN(result.Y) || double.IsNaN(result.Z))
{
Debug.LogWarning("GetLatLonFromUnityPos returned NaN. Returning default value.");
return new ArcGISPoint(0,0,0); // Return a default value (0, 0, 0) in case of NaN
}
return result;

}

Can you tell me why it's taking so long to initialize

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions