microsoft / MapsSDK-Unity

This repository contains samples, documentation, and supporting scripts for Maps SDK, a Microsoft Garage project.
MIT License
650 stars 128 forks source link

Getting LatLon when clicking on map #181

Closed cafigz closed 2 years ago

cafigz commented 2 years ago

Hi! I managed to get the Latitude and Longitude of the point where my RayCast hits, but now I want it to only trigger when I'm either pressing on the map (near interaction) or clicking on it with the air tap. At the moment this is my code: image

My question is: How to I change the if to only trigger when I air tap or use the near interaction?

Best regards

kircher1 commented 2 years ago

Take a look at how the MixedRealityMapInteractionHandler component is used in the sample project. There should be an event to hook into for getting clicks on the map.

If it doesn't exactly do what you need, the implementation of that class should be a helpful reference: https://github.com/microsoft/MapsSDK-Unity/blob/master/SampleProject/Assets/Microsoft.Maps.Unity.Examples/Common/Scripts/MixedRealityMapInteractionHandler.cs