从点击点获取地理位置。 windows 商店项目 (c#)
Get Geolocation from a tapped point . windows store project (c#)
我正在创建一个使用 mapcontrol 的应用程序,我想根据用户点击的点获取地理位置,但我不知道如何获取它。 Whosebug 中的另一个问题没有对我有用的解决方案。
我已经下载了 bing.maps 扩展,但我无法引用它。 Thete 是我正在使用的命名空间。
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.Devices.Geolocation;
using Windows.UI.Xaml.Shapes;
using Windows.UI.Xaml.Controls.Maps;
using Windows.UI;
using Windows.Phone;
using Windows.Storage.Streams;
我在网上搜索了一下,在 MapControl class 中找到了一个方法。 (MapControl.GetLocationFromOffset)。它可以工作吗?以及如何使用它...我知道这个存在但我无法创建一个变量来存储这个值... GeoLocator .. GeoPoint .. GeoCoordinate, var .. object , none 这个适用于我.
有人知道如何将点击的点转换为地理坐标(纬度和经度)吗?
为了响应用户点击地图,我假设您已经为 MapControl 的 MapTapped 事件设置了一个处理程序。处理程序的参数之一是具有 属性 位置的 MapInputEventArgs。这是一个 GeoPoint,您应该可以从中获取 Lat/Lon。
我正在创建一个使用 mapcontrol 的应用程序,我想根据用户点击的点获取地理位置,但我不知道如何获取它。 Whosebug 中的另一个问题没有对我有用的解决方案。
我已经下载了 bing.maps 扩展,但我无法引用它。 Thete 是我正在使用的命名空间。
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.Devices.Geolocation;
using Windows.UI.Xaml.Shapes;
using Windows.UI.Xaml.Controls.Maps;
using Windows.UI;
using Windows.Phone;
using Windows.Storage.Streams;
我在网上搜索了一下,在 MapControl class 中找到了一个方法。 (MapControl.GetLocationFromOffset)。它可以工作吗?以及如何使用它...我知道这个存在但我无法创建一个变量来存储这个值... GeoLocator .. GeoPoint .. GeoCoordinate, var .. object , none 这个适用于我.
有人知道如何将点击的点转换为地理坐标(纬度和经度)吗?
为了响应用户点击地图,我假设您已经为 MapControl 的 MapTapped 事件设置了一个处理程序。处理程序的参数之一是具有 属性 位置的 MapInputEventArgs。这是一个 GeoPoint,您应该可以从中获取 Lat/Lon。