Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Delphi para la web
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-12-2015
marcial marcial is offline
Miembro
 
Registrado: may 2003
Posts: 147
Poder: 21
marcial Va por buen camino
Question Google Maps y OpenStreetMaps

Hola a todos:

Trabajo con D5 y tengo el siguiente problema:

Tengo una aplicación que, usando Google Maps V3, me posiciona una marca en la dirección de por ejemplo un cliente. Esto lo hace perfectamente, pero lo que no consigo es que cuando arrastro el mapa hacia cualquier lado, éste se vuelva a repintar; es decir, que el mapa conforme me lo llevo p.ej. hacia abajo, por la parte de arriba no se vuelve a dibujar, es como si fuera una imagen del tamaño del contenedor (WebBrowser) que se arrastra pero no se repinta.

Lo mismo lo intento con OpenStreetMap y el mapa SI vuelve a repintar cuando se arrastra.

Os agradecería me dijerais si es que Google Maps no puede hacerlo o es que no lo estoy haciendo bien.

Muchas gracias por emplear vuestro tiempo en ayudarme.
Responder Con Cita
  #2  
Antiguo 10-12-2015
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.022
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
¿Y cómo lo haces?
Responder Con Cita
  #3  
Antiguo 10-12-2015
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.233
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Lo dicho.
Todo depende de cómo estés visualizando el mapa.

Google maps, posee un modo de imágenes estáticas, es decir, en que en lugar de un mapa, cargas un trozo de mapa, como si fuera una imagen.
¿No estarás utilizando ese modo?
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #4  
Antiguo 10-12-2015
marcial marcial is offline
Miembro
 
Registrado: may 2003
Posts: 147
Poder: 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 12:02:30.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
GPS y Google Maps MAXIUM Internet 5 15-03-2011 19:15:05
Google Maps madiazg Varios 4 26-10-2008 23:03:41
google maps MOCOSO07 Varios 2 06-08-2008 19:08:22
Google maps y php halizia PHP 2 16-03-2007 18:04:49
Google Maps .es Neftali [Germán.Estévez] Noticias 0 27-04-2006 14:32:54


La franja horaria es GMT +2. Ahora son las 15:19:08.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi