【问题标题】:Get Geolocation from a tapped point . windows store project (c#)从点击点获取地理位置。 windows 商店项目 (c#)
【发布时间】:2015-07-25 14:32:29
【问题描述】:

我正在创建一个使用地图控件的应用程序,我想根据用户的点击点获取地理位置,但我不知道如何获取它。 stackoverflow 中的其他问题中没有对我有用的解决方案。

我已经下载了 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 类中找到了一个方法。 (MapControl.GetLocationFromOffset)。它可以工作吗?以及如何使用它......我知道它存在,但我无法创建一个变量来存储这个值...... GeoLocator .. GeoPoint .. GeoCoordinate, var .. object ,这些都不适合我。

有人知道如何将点击的点转换为地理坐标(纬度和经度)吗?

【问题讨论】:

    标签: c# .net xaml gps windows-store-apps


    【解决方案1】:

    为了响应用户点击地图,我假设您为 MapControl 的 MapTapped 事件设置了一个处理程序。处理程序的参数之一是具有属性 Location 的 MapInputEventArgs。这是一个 GeoPoint,您应该能够从中获取 Lat/Lon。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-21
      • 2016-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多