我找不到任何有关如何使用数据库查询(sql)并在地图上显示所有结果的消息,而我只有地址, 我有大约12,000个结果,我所拥有的只是街道名称&号码+城市名称, 我每次都能获得一个结果,我需要得到更多的结果
public async Task<ActionResult> Index()
{
var model = await db.synagogues.Take(5).ToListAsync();
return View(model.ToList());
}
并按foreach
获取地图结果。
function codeAddress() {
var address = document.getElementById('address' + i).value;
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
}
google.maps.event.addDomListener(window, 'load', initialize);