Topic: Marker Position

If I create a marker then the marker is put at the current position and the map is shown with this position in the middle of the "screen". If I then zoom/rotate the Map the marker remains in the middle of the screen. Is it possible to have this behaviour except that the marker is positioned at another position? For example at the bottom in the middle? Zoom/Rotate should then maintain the marker position.

Jaap van Driel

Re: Marker Position

Hi.

Unfortunately, I didn't understand your description of the problem and your questions.

First of all, which markers are you talking about (2D or 3D)?
Next, the behavior you describe is not a standard behavior when creating markers, and is most likely implemented by your scripts, right?

Please rephrase your problem description and questions in more detail.
If any of your scripts are related to this, please show them.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Marker Position

Sorry for the confusion. I use a standard map on an android phone. With the standard 2D marker at the current position. All using the setup from your manual. The map is set to rotate with the compass. What I see is the marker in the middle of the texture and if I point the phone in a given direction I see on the map what is arround me with the top of the texture showing what is in front of me. What I want is the marker at the bottom of the texture as I am online interested in what is in front of me. I can do this in a script, but I was wondering if I missed a standard setting.

Jaap van Driel

Re: Marker Position

Unfortunately, there is no setting for this.
But I can give an example of how to do it, which I made a long time ago for another user:

using UnityEngine;

public class MarkerAtBottom : MonoBehaviour
{
    public float distance = 1;
    private OnlineMapsMarker marker;

    private void Start()
    {
        OnlineMapsCameraOrbit.instance.OnCameraControl += OnCameraControl;

        marker = OnlineMapsMarkerManager.CreateItem(OnlineMaps.instance.position);
        marker.OnPositionChanged += m => OnCameraControl();
    }

    private void OnCameraControl()
    {
        float angle = (270 + OnlineMapsCameraOrbit.instance.rotation.y) * Mathf.Deg2Rad;

        double tx, ty;
        marker.GetTilePosition(out tx, out ty);
        OnlineMaps.instance.SetTilePosition(tx + Mathf.Cos(angle) * distance, ty + Mathf.Sin(angle) * distance);
    }
}
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.