如何将地理编码与已知坐标相结合?可以说,我想显示坐标数组中的标记。
function codeAddress()
{
var latlng = new google.maps.LatLng(42.745334, 12.738430);
var address = document.getElementById("location").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var mapOptions = {
zoom: 11,
center: results[0].geometry.location,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
icon: image_icon
});
}
});
}
所以我有一个值的纬度坐标和地址,我如何将这两者结合到地图中?
谢谢!