必应地图-反向地理编码 [英] Bing Maps - Reverse Geocoding

查看:205
本文介绍了必应地图-反向地理编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

Hi I have this following code:

function reverseGeocodeRequest() {
          createSearchManager();
          var userData = { name: 'Maps Test User', id: 'XYZ' };
          map.setView({ zoom: 10 });
          var request =
          {
              location: new Microsoft.Maps.Location(38.711232538952245, -9.13513183593749),
              callback: onReverseGeocodeSuccess,
              errorCallback: onReverseGeocodeFailed,
              userData: userData
          };
          searchManager.reverseGeocode(request);
      }


但是坐标是手动插入的,我想通过文本框指定值,有人可以帮我吗?

问候.


But the coordinates are inserted manually, I want to give that values by textbox´s can anyone help me?

Regards.

推荐答案

function reverseGeocodeRequest() {
          var latitude = document.getElementById('txtLatitude').value;
          var longitude = document.getElementById('txtLongitude').value;
          createSearchManager();
          var userData = { name: 'Maps Test User', id: 'XYZ' };
          map.setView({ zoom: 10 });
          var request =
          {
              location: new Microsoft.Maps.Location(latitude, longitude),
              callback: onReverseGeocodeSuccess,
              errorCallback: onReverseGeocodeFailed,
              userData: userData
          };
          searchManager.reverseGeocode(request);
      }


这篇关于必应地图-反向地理编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆