Topic: Mouse Input Query
Hi,
As per my design requirement, I need to add
- right click to add the marker
- left click and drag to drag the map
i need to understand what will be the correct way to achieve this.
Thank you.
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → Mouse Input Query
Hi,
As per my design requirement, I need to add
- right click to add the marker
- left click and drag to drag the map
i need to understand what will be the correct way to achieve this.
Thank you.
Hi.
An example of how to create markers using the right mouse button:
using UnityEngine;
public class CreateMarkerByRMB : MonoBehaviour
{
private void Update()
{
if (!Input.GetMouseButtonDown(1)) return;
double longitude, latitude;
if (!OnlineMapsControlBase.instance.GetCoords(out longitude, out latitude)) return;
OnlineMapsMarkerManager.CreateItem(longitude, latitude, "Marker");
}
}Moving the map using the left mouse button is a built-in behavior and you don't need to do anything for it.
Infinity Code Forum → Online Maps Help → Mouse Input Query
Powered by PunBB, supported by Informer Technologies, Inc.