salve io sto utilizzando la jquery gmap.
dai file scaricati ho visualizzato questi due esempi
il test6 permette di ottenere la latitudine e longitudine partendo da un indirizzo testuale.
Il secondo mi servirebbe per visualizzare la mappa e muovere il marker per avere la lat e long precisi.
in pratica mi servirebbe il modo di fondere queste soluzioni e trovare la soluzione di inserire i valori di lat e long in questa variabile var position = new google.maps.LatLng(-33, 151); del secondo esempio partendo da un indirizzo testuale
come posso fare? grazie
$('#test6').gmap3(
{ action: 'getLatLng',
address: '2 bis rue saint antoine, eguilles',
callback: function(result){
if (result){
$('#test6-result .result-1').html( result[0]['geometry']['location'].lat() );
$('#test6-result .result-2').html( result[0]['geometry']['location'].lng() );
$(this).gmap3({action: 'setCenter', args:[ result[0].geometry.location ]});
} else {
alert('Bad address 2 !');
}
}
}
);
var position = new google.maps.LatLng(-33, 151);
$('#test8').gmap3(
{
action: 'addMarker',
latLng: position,
map:{
center: position,
zoom: 8
},
marker:{
options:{
draggable: true,
icon: 'http://code.google.com/intl/fr/apis/maps/documentation/javascript/examples/images/beachflag.png'
},
events:{
dragend: function(marker, event){
$('#test8-result .result-1').html( marker.position.lat() );
$('#test8-result .result-2').html( marker.position.lng() );
}
}
}
},
{action: 'setOptions', args:[{scrollwheel:true}]}
);