に私はJavascriptコードに続いていると私は私のマップ逆ジオコーディングGoogle MapsのAPI 3
のリバースジオコーディングを適用したいここで私のJSコード
更新
<script type="text/javascript">
var map;
var geocoder;
var markers = new Array();
function initialize() {
geocoder = new google.maps.Geocoder();
var GPS = <%=GPS %>
var latlng = new google.maps.LatLng(31.2330555556,72.3330555556);
var myOptions = {
zoom: 7,
scaleControl:true,
pancontrol: true,
streetViewControl: true,
center: latlng,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
mapTypeId: google.maps.MapTypeId.HYBRID
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var infowindow = new google.maps.InfoWindow();
for(i=0; i<GPS.length; i++)
{
//GeoCoding
if (geocoder) {
geocoder.geocode({'latLng': latlng}, function(results, status)
{
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
markers[i] = new google.maps.Marker(
{
position: GPS[i].GPS,
map: map,
draggable:true,
Info: results[1].formatted_address,
title:GPS[i].TITLE
}
}
}
});
google.maps.event.addListener(markers[i], 'click', function() {
infowindow.setContent(this.Info);
infowindow.open(map,this);
});
}
}
</script>
卿です私の更新されたコードです逆ジオコーディングのコードを書きましたが、今はMUマップが機能していません教えてください正確に私は行方不明です
ライブサイトにある場合、または完全なコードをjsFiddleのようなものに入れるとデバッグするのが簡単になるので、テストすることができます。 –
Manoと合意すれば、実際にライブコードにリンクする必要があります。 – andresf