【发布时间】:2015-08-06 10:53:54
【问题描述】:
我有一个 mySql 数据库,其中包含由 lat 和 lng 指定的起始位置和结束位置以及起始日期和时间的路线。
然后我有一个网页(经典 asp),用户可以在其中使用 Google 地图 api 输入日期、时间和位置。
当用户输入一个位置时,我想循环访问数据库以查看在给定时间内是否有任何路线经过用户位置,然后显示结果,以便他可以选择他喜欢的路线。
我一直在查看 isLocationOnEdge,但我不知道如何使用它以及如何获取价值,以便我可以在我的 asp 中使用它。
我找到了这段代码,但正如我所说 - 不知道必须使用它,所以它适合我的问题:
function initialize() {
var mapOptions = {
zoom: 5,
center: new google.maps.LatLng(24.886, -70.269),
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
var cascadiaFault = new google.maps.Polyline({
path: [
new google.maps.LatLng(49.95, -128.1),
new google.maps.LatLng(46.26, -126.3),
new google.maps.LatLng(40.3, -125.4)
]
});
var myPosition = new google.maps.LatLng(43.0, -125.9, 10e-7);
if (google.maps.geometry.poly.isLocationOnEdge(myPosition, cascadiaFault)) {
alert("Relocate!");
}
}
google.maps.event.addDomListener(window, 'load', initialize);
有人可以帮助我吗?或者只是给出一些我可以遵循的提示?
【问题讨论】:
标签: mysql google-maps-api-3 asp-classic