il problema e' che forse l'esempio lo fanno prendendo le coordinate mentre io sto prendendo l'indirizzo preciso degli alberghi.
non ho capito bene come modificare il mio codice:
var map = null;
var geocoder = null;
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(40.727356,13.909893), 12);
//map.setMapType(G_SATELLITE_MAP );
geocoder = new GClientGeocoder();
}
}
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
var marker = new GMarker(point);
map.addOverlay(marker);
//marker.openInfoWindowHtml(address);
}
}
);
}
}
questo dovrebbe essere un pezzo di codice da prendere
http://www.google.com/apis/maps/docu..._Above_Markers

Rispondi quotando