Ver Mensaje Individual
  #4  
Antiguo 10-12-2015
marcial marcial is offline
Miembro
 
Registrado: may 2003
Posts: 147
Reputación: 21
marcial Va por buen camino
Vaya, eso de las imágenes estaticas no lo sabia. El script es este:

Código:
HTMLStr: String = 
'<html> '+
'<head> '+
'<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" /> '+
'<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3&sensor=true"></script> '+
'<script type="text/javascript"> '+
''+
'  var geocoder; '+
'  var map;  '+
'  var markersArray = [];'+
'  var wait = false;'+
'  var lat;'+
'  var lang;'+
'  var LatLng;'+
''+
'  function initialize() { '+
'    geocoder = new google.maps.Geocoder();'+
'    var myOptions = { '+
'      zoom: 17, '+
'      draggable: true, '+
'      mapTypeId: google.maps.MapTypeId.ROADMAP '+ 
'    }; '+ '    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); '+
'  } '+
''+
'  function PutMarkerDireccion(address) { '+
'    if (geocoder) {'+
'     geocoder.geocode( { address: address}, function(results, status) { '+
'  var infowindow = new google.maps.InfoWindow({'+
'  Content: "<br>" +address+ "<br>" + " Cordenadas: " +results[0].geometry.location.lat() +" "+results[0].geometry.location.lng()});'+

'        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,'+
'              Title: Nombre});'+
'              markersArray.push(marker);'+
'       wait = true;'+
'       setTimeout("wait = true", 2000);'+

'       } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {'+
'       wait = true;'+
'       setTimeout("wait = true", 2000);'+
'          var marker = new google.maps.Marker({'+
'              map: map,'+
'              position: results[0].geometry.location.lat(),'+
'              position: results[0].geometry.location.lng(),'+
'              Title: Nombre});'+
'              markersArray.push(marker);'+

'       } else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {'+
'       wait = true;'+
'       setTimeout("wait = true", 1000);'+

'        } else {'+
'          alert("Geocode was not successful for the following reason: " + status);'+
'        }'+
'      });'+
'    }'+
'  }'+
''+
''+
'function ClearMarkers() {  '+
'  if (markersArray) {        '+
'    for (i in markersArray) {  '+
'      markersArray[i].setMap(null); '+
'    } '+
'  } '+
'}  '+
''+
''+'</script> '+
'</head> '+
'<body onload="initialize()"> '+
'  <div id="map_canvas" style="width:100%; height:100%"></div> '+
'  <div id="latlong"> '+
'  <input type="hidden" id="latValue" >'+
'  <input type="hidden" id="lngValue" >'+

'</body> '+
'</html> ';

y la llamada:
Código Delphi [-]
  HTMLWindow2.execScript(Format('PutMarkerDireccion(%s)',[QuotedStr(address)]), 'JavaScript');

Última edición por dec fecha: 10-12-2015 a las 11:02:30.
Responder Con Cita