【发布时间】:2013-02-06 08:02:09
【问题描述】:
我们想检查一个位置是否在可见的 Bing 地图上,但我们目前的努力告诉我们所有位置都在地图上。
初始化地图后,我们使用 Map 'getBounds' 方法返回当前地图的 LocationRect:
var mapRect = MAP.getBounds();
然后我们使用地图中的值初始化一个位置矩形:
var rect = new Microsoft.Maps.LocationRect(mapRect);
然后使用LocationRect方法'contains'进行检查:
alert ("结果:" + rect.contains(new Microsoft.Maps.Location(38.0, 5.0)));
我猜这是因为我们用错误的值初始化矩形,我们将不胜感激提供一些关于我们做错了什么的线索。
【问题讨论】:
标签: bing-maps