Google Maps - Ajustar Mapa é possível?

Post Reply
FWHISHOW
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm

Google Maps - Ajustar Mapa é possível?

Post by FWHISHOW »

Pessoal é possível ajustar o mapa (google maps) ao tamanho que eu especifiquei. SIZE 285,170.

ex:

@ 418,08 ACTIVEX oActive PROGID "Shell.Explorer" OF oWnd SIZE 285,170
oActive:Do( "Navigate", CurDrive() + ":\" + CurDir() + "\temp.html" )


Falo isso, porque só tenho este espaço na tela, e o mapa é apresentado, mais fica deslocado... Tenho então que usar o mouse para ir até a posição que eu quero.
User avatar
fgondi
Posts: 636
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Post by fgondi »

El problema está en gmap.html

En este archivo se define el espacio del mapa de forma fija

Code: Select all

<div id="map_canvas" style="width: 597px; height: 376px"></div>
Tienes dos posibilidades:
1.- Cambiar esos valores para que se ajuste a tu ventana
2.- Cambiar gmap.html, para que él sólo ajuste el mapa al tamaño de la ventana

Para que el mapa se redimensione al 100% de la ventana hay que cambiar lo siguiente en el archivo gmap.html

1.- Dentro de la estructura <stule type="text/css"> incluir lo siguiente:

Code: Select all

    <style type="text/css">
      @import url("http://www.google.com/uds/css/gsearch.css");
      @import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");
      #map_canvas {
        position:absolute;
        margin-top: 0%;
        margin-right: 0%;
        margin-bottom: 0%;
        margin-left: 0%;
        left:0%;
        right:0%
        top:0%;
        Bottom:0%;
        padding:0;
        width:100%;
        height:100%;
      }      
    </style>            
2.- Quitar de la definición de la división <div> el tamaño ya que lo acabamos de definir

Code: Select all

        <div id="map_canvas"></div> 
Un saludo
Fernando González Diez
ALSIS GHE Sistemas Informáticos
FWHISHOW
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm

Post by FWHISHOW »

Fernando,

1.- Dentro de la estructura <stule type="text/css"> incluir lo siguiente:


cHtml2 :=[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ]+CRLF
cHtml2 +=[ <html xmlns="http://www.w3.org/1999/xhtml"> ]+CRLF
cHtml2 +=[ <head> ]+CRLF
cHtml2 +=[ <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> ]+CRLF
cHtml2 +=[ <title> </title> ]+CRLF
cHtml2 +=[ <script src="http://maps.google.com/maps?file=api&v= ... EomegYBo1w" type="text/javascript"></script> ]+CRLF
cHtml2 +=[ <script type="text/javascript"> ]+CRLF
cHtml2 +=" var map = null; "+CRLF
cHtml2 +=" var geocoder = null; "+CRLF
cHtml2 +=" var coords = null; "+CRLF+CRLF
cHtml2 +=" function initialize() { "+CRLF
cHtml2 +=" if (GBrowserIsCompatible()) { "+CRLF
cHtml2 +=[ map = new GMap2(document.getElementById("map_canvas")); ]+CRLF
cHtml2 +=" map.addControl(new GLargeMapControl()); "+CRLF
cHtml2 +=" map.addControl(new GMapTypeControl()); "+CRLF
cHtml2 +=" geocoder = new GClientGeocoder(); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF+CRLF
cHtml2 +=" function showAddress(address, cAddressName) { "+CRLF
cHtml2 +=" if (geocoder) { "+CRLF
cHtml2 +=" geocoder.getLatLng( "+CRLF
cHtml2 +=" address, "+CRLF
cHtml2 +=" function(point) { "+CRLF
cHtml2 +=" if (!point) { "+CRLF
cHtml2 +=[ showAddress2('<<CITY>>'); ]+CRLF
cHtml2 +=" } else { "+CRLF
cHtml2 +=" map.setCenter(point, 15); "+CRLF
cHtml2 +=" var marker = new GMarker(point); "+CRLF
cHtml2 +=" map.addOverlay(marker); "+CRLF
cHtml2 +=" coords = marker.getPoint(); "+CRLF
cHtml2 +=[ var curl = cAddressName + "<p>" + coords.toUrlValue(6) + "</p>" ]+CRLF
cHtml2 +=[ var button = '<input type="button" value="Imprimir" onClick="window.print()"/>;' ]+CRLF
cHtml2 +=" curl = curl + button "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" ); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF+CRLF
cHtml2 +=" function showAddress2(address) { "+CRLF
cHtml2 +=" if (geocoder) { "+CRLF
cHtml2 +=" geocoder.getLatLng( "+CRLF
cHtml2 +=" address, "+CRLF
cHtml2 +=" function(point) { "+CRLF
cHtml2 +=" if (!point) { "+CRLF
cHtml2 +=[ alert(address + " not found"); ]+CRLF
cHtml2 +=" } else { "+CRLF
cHtml2 +=" map.setCenter(point, 15); "+CRLF
cHtml2 +=" var marker = new GMarker(point); "+CRLF
cHtml2 +=" map.addOverlay(marker); "+CRLF
cHtml2 +=" marker.openInfoWindowHtml(address); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" ); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" </script> "+CRLF
cHtml2 +=" </head> "+CRLF+CRLF
cHtml2 +=[ <body onload="initialize(); showAddress('<<STREET>>, <<CITY>> <<COUNTRY>>', '<<STREET>>, <<CITY>> <<COUNTRY>>');" onunload="GUnload()" ]+CRLF
cHtml2 +=[ <div id="map_canvas" style="width: 285px; height: 170px"></div> ]+CRLF
cHtml2 +=" </body> "+CRLF
cHtml2 +="</html> "


Fernando o código gmap que tenho é esse, não encontrei parte que usted referiu, pode me ajudar?

Grato
User avatar
fgondi
Posts: 636
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Post by fgondi »

Incluye/Cambia lo siguiente:

cHtml2 :=[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ]+CRLF
cHtml2 +=[ <html xmlns="http://www.w3.org/1999/xhtml"> ]+CRLF
cHtml2 +=[ <head> ]+CRLF
cHtml2 +=[ <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> ]+CRLF
cHtml2 +=[ <title> </title> ]+CRLF
cHtml2 +=[ <style type="text/css"> ]+CRLF
cHtml2 +=[ @import url("http://www.google.com/uds/css/gsearch.css"); ]+CRLF
cHtml2 +=[ @import url("http://www.google.com/uds/solutions/loc ... search.css"); ]+CRLF
cHtml2 +=[ #map_canvas { ]+CRLF
cHtml2 +=[ position:absolute; ]+CRLF
cHtml2 +=[ margin-top: 0%; ]+CRLF
cHtml2 +=[ margin-right: 0%; ]+CRLF
cHtml2 +=[ margin-bottom: 0%; ]+CRLF
cHtml2 +=[ margin-left: 0%; ]+CRLF
cHtml2 +=[ left:0%; ]+CRLF
cHtml2 +=[ right:0% ]+CRLF
cHtml2 +=[ top:0%; ]+CRLF
cHtml2 +=[ Bottom:0%; ]+CRLF
cHtml2 +=[ padding:0; ]+CRLF
cHtml2 +=[ width:100%; ]+CRLF
cHtml2 +=[ height:100%; ]+CRLF
cHtml2 +=[ } ]+CRLF
cHtml2 +=[ </style> ]+CRLF
cHtml2 +=[ <script src="http://maps.google.com/maps?file=api&v= ... EomegYBo1w" type="text/javascript"></script> ]+CRLF
cHtml2 +=[ <script type="text/javascript"> ]+CRLF
cHtml2 +=" var map = null; "+CRLF
cHtml2 +=" var geocoder = null; "+CRLF
cHtml2 +=" var coords = null; "+CRLF+CRLF
cHtml2 +=" function initialize() { "+CRLF
cHtml2 +=" if (GBrowserIsCompatible()) { "+CRLF
cHtml2 +=[ map = new GMap2(document.getElementById("map_canvas")); ]+CRLF
cHtml2 +=" map.addControl(new GLargeMapControl()); "+CRLF
cHtml2 +=" map.addControl(new GMapTypeControl()); "+CRLF
cHtml2 +=" geocoder = new GClientGeocoder(); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF+CRLF
cHtml2 +=" function showAddress(address, cAddressName) { "+CRLF
cHtml2 +=" if (geocoder) { "+CRLF
cHtml2 +=" geocoder.getLatLng( "+CRLF
cHtml2 +=" address, "+CRLF
cHtml2 +=" function(point) { "+CRLF
cHtml2 +=" if (!point) { "+CRLF
cHtml2 +=[ showAddress2('<<CITY>>'); ]+CRLF
cHtml2 +=" } else { "+CRLF
cHtml2 +=" map.setCenter(point, 15); "+CRLF
cHtml2 +=" var marker = new GMarker(point); "+CRLF
cHtml2 +=" map.addOverlay(marker); "+CRLF
cHtml2 +=" coords = marker.getPoint(); "+CRLF
cHtml2 +=[ var curl = cAddressName + "<p>" + coords.toUrlValue(6) + "</p>" ]+CRLF
cHtml2 +=[ var button = '<input type="button" value="Imprimir" onClick="window.print()"/>;' ]+CRLF
cHtml2 +=" curl = curl + button "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" ); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF+CRLF
cHtml2 +=" function showAddress2(address) { "+CRLF
cHtml2 +=" if (geocoder) { "+CRLF
cHtml2 +=" geocoder.getLatLng( "+CRLF
cHtml2 +=" address, "+CRLF
cHtml2 +=" function(point) { "+CRLF
cHtml2 +=" if (!point) { "+CRLF
cHtml2 +=[ alert(address + " not found"); ]+CRLF
cHtml2 +=" } else { "+CRLF
cHtml2 +=" map.setCenter(point, 15); "+CRLF
cHtml2 +=" var marker = new GMarker(point); "+CRLF
cHtml2 +=" map.addOverlay(marker); "+CRLF
cHtml2 +=" marker.openInfoWindowHtml(address); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" ); "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" } "+CRLF
cHtml2 +=" </script> "+CRLF
cHtml2 +=" </head> "+CRLF+CRLF
cHtml2 +=[ <body onload="initialize(); showAddress('<<STREET>>, <<CITY>> <<COUNTRY>>', '<<STREET>>, <<CITY>> <<COUNTRY>>');" onunload="GUnload()" ]+CRLF
cHtml2 +=[ <div id="map_canvas"></div> ]+CRLF
cHtml2 +=" </body> "+CRLF
cHtml2 +="</html> "
Un saludo
Fernando González Diez
ALSIS GHE Sistemas Informáticos
FWHISHOW
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm

Post by FWHISHOW »

Gracias Fernando!
FWHISHOW
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm

Post by FWHISHOW »

Fernando, usted sabes como fazer para que o mapa mostre o ponto de partida até um ponto final. Ou seja, o caminho a ser percorrido até o destino?

Gracias meu amigo
User avatar
fgondi
Posts: 636
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España
Contact:

Post by fgondi »

No he probado si se puede hacer. Lo siento

Si he visto que en su tooltip aparece el texto
"Obtener indicaciones: Hasta aquí - Desde aquí"
Y con eso se puede calcular rutas de desde/hasta ese punto.

Lo que no sé es como mostrar su tooltip.
Un saludo
Fernando González Diez
ALSIS GHE Sistemas Informáticos
FWHISHOW
Posts: 80
Joined: Thu Nov 29, 2007 2:01 pm

Post by FWHISHOW »

Gracias mais um vez Fernando!
Post Reply