Add Google Maps driving directions to your website Acrescentar o Google Maps de direção para o seu site
Posted on April 29, 2008 at 5:23 am Postado em 29 de abril de 2008 em 5:23 am
I love using Google Maps “Get Directions” feature any time I need to figure how to get from point A to B. It’s one of the best ways to get driving directions in the USA for sure. Eu adoro usar o Google Maps "Como chegar" característica qualquer momento que preciso fazer para obter valor a partir do ponto A para B. É 'uma das melhores maneiras de obter uma rota no E.U.A. com certeza.
So what if you have a wedding website or a MySpace page and you’re throwing a big party, wouldn’t it be nice if your guests could go to your site, type in the address they will be coming from and automatically get directions to the event location!? Então o que se você tem um site ou um casamento página MySpace e você estiver jogando uma grande festa, não seria bom se os seus convidados poderão ir para o seu site, digite o endereço em que serão provenientes de direções e de obter automaticamente a local do evento? Not sure what I mean? Não tem certeza o que quero dizer? Type your address in the box below and you’ll get directions from your address to my house: Digite seu endereço na caixa abaixo e você receberá instruções do seu endereço para a minha casa:
Cool huh? Cool não? You can easily create this little form on any website, blog, or anywhere you can put in some HTML code! Você pode facilmente criar este pequeno formulário em qualquer site, blog, ou em qualquer lugar que você pode colocar em algum código HTML! This is also great for small business web sites as you can throw it up on your contact page and people can get directions quickly, rather than having to copy your address, open a new window, and then type in their starting address. Isto também é grande para os pequenos negócios como os sites que você pode deitar-se sobre o seu contato página e as pessoas podem obter rapidamente direções, em vez de ter de copiar o seu endereço, abrir uma nova janela e, em seguida, digite na sua partida endereço.
So how do we go about creating this modified get directions box? Então como vamos fazer sobre a criação deste modificada trajetos casa? Well first, we’ll need to get the correct syntax for the URL that Google uses for directions. Bem antes de mais, vamos precisar de obter a sintaxe correta para o URL que o Google usa para os sentidos. Luckily, we can figure that out by getting directions between two places and then clicking on the Send link at the top right. Felizmente, podemos chegar ao valor que as direcções entre dois locais e, em seguida, clicar no link Enviar na parte superior direita.
Here’s what you end up getting: Veja o que você acabar ficando:
Notice the link in the email message! Aviso no link na mensagem de e-mail! That’s what we need! Isso é o que nós precisamos! Here’s what the entire link looks like right now: Veja o que todo o link parece neste momento:
http://maps.google.com/maps?f=d&hl=en&geocode=&saddr= 6348+Pratt+Dr,+New+Orleans,+LA+70122+(Pratt+Home)&daddr=4601+lennox+blvd,+new+orleans,+la&sll=37.0625,-95.677068&sspn=33.214763,82.265625&ie=UTF8&z=12 http://maps.google.com/maps?f=d&hl=en&geocode=&saddr = 6348 + + Dr. Pratt, + + New Orleans, LA 70122 + + (Pratt + Home) daddr = 4601 & + + Lennox Blvd, + nova orleans +, + la & SLL = 37.0625, -95,677068 & sspn = 33.214763,82.265625 & ie = UTF8 & z = 12
Eeeks! That’s pretty long! Isso é muito bonito! There are a lot of fields in the URL, such as SADDR (starting address), DADDR (destination address), hl (language), and some more stuff related to the latitude and longitude. Há uma grande quantidade de campos no URL, tais como SADDR (começando endereço), DADDR (endereço destino), hl (língua), e de mais algumas coisas relacionadas com a latitude e longitude.
However, you don’t really need all of these fields in order for Google to give you driving directions! No entanto, você realmente não precisa de todos esses campos para que o Google para lhe dar instruções de direção! All you need is this: Tudo o que você precisa é esta:
http://maps.google.com/maps?saddr=start&daddr=end http://maps.google.com/maps?saddr=start&daddr=end
Go ahead and give it a shot. Vá em frente e dar-lhe um tiro. Put in an address in quotes for the starting and ending address and paste the URL into your browser! Coloque em um endereço na cotação para a primeira e última morada e cole a URL no seu navegador! I replaced start with my home city New Orleans and end with Houston, TX, so this is what my Google Maps directions URL looks like: Eu substituído começar a minha cidade natal Nova Orleans e terminam com Houston, TX, então é isso que o meu Google Maps direções URL aparência:
Pretty nifty eh! Pretty bacana eh! Isn’t it fun to mess around with these types of things! Não é se divertir com a confusão em torno deste tipo de coisas! Ok, so now that we have a URL that we can pass into Google Maps, we need to create a simple form with two fields, one for the starting address and one for the destination address. Ok, agora que temos uma URL que podemos passar para o Google Maps, temos de criar um formulário simples com dois campos, um endereço para a partida e um destino para o endereço.
If you want people to just type in their address and get directions to your place, then we’ll want the second field to be hidden and already set to the destination address. Se você gostaria que as pessoas apenas digite seu endereço de e trajetos para o seu lugar, então nós queremos o segundo campo para ser escondida e já fixados para o endereço destino.
<form action=”http://maps.google.com/maps” method=”get” target=”_blank”> <form action="http://maps.google.com/maps" method="get" target="_blank">
Enter your starting address: Digite seu endereço partida:
<input type=”text” name=”saddr” /> <input type="text" name="saddr" />
<input type=”hidden” name=”daddr” value=”6348 Pratt Dr, New Orleans, LA” /> <input type="hidden" name="daddr" value="6348 Pratt Dr, Nova Orleans, LA" />
<input type=”submit” value=”get directions” /> <input type="submit" value="get directions" />
</form> </ form>
Check out the code above. Confira o código acima. The first line starts out form and says that when the submit button is clicked, the data should be sent to maps.google.com/maps. A primeira linha começa a forma e diz que quando é clicado no botão enviar, os dados deverão ser enviados para o maps.google.com / mapas. The target=blank means that we want the result to open in a new window. O alvo = branco significa que queremos que o resultado de abrir em uma nova janela. Then we have a text box for the starting address, which is blank. Então, temos um texto para a casa de partida a morada, que está em branco.
The second text box is hidden and the value is the destination address that we desire. O segundo texto está escondido caixa e do valor destino é o endereço que nós desejamos. Finally, there is a submit button with the title “Get Directions”. Por último, há um botão Submeter com o título de "Como chegar". Now when someone types in their address, they’ll get this: Agora, quando alguém nos seus tipos de endereço, elas terão o seguinte:
You can customize the directions and map even more by following the same procedure as I went through above. Você pode personalizar as direções e mapa ainda mais a seguir o mesmo procedimento que me passou por cima. For example, let’s say you don’t want the default view to be maps, but instead want it to be Satellite and show Traffic . Por exemplo, digamos que você não quer ver o padrão a ser mapas, mas sim queremos que seja e por satélite mostram o tráfego. Type in your directions and then press the Satellite and Traffic buttons on the Google map. Digite sua direção e, em seguida, pressione o Satélite de tráfego e botões do Google sobre o mapa. Next, click on Send and you’ll see the modified URL: Em seguida, clique em Enviar e você verá o modificada URL:
Notice the layer=t and t=h fields in the URL. Aviso a camada e t = t = h campos no URL. layer=t is for the traffic layer and t=h means satellite in some strange fashion! t = camada é para o tráfego camada e t = h significa satélite em alguma estranha moda! Just tack those on to your final URL and you’ve now got a highly customized Google Maps Get Directions form on your site! Apenas aqueles em rumo ao seu final URL e você já tem uma altamente personalizada do Google Maps Como chegar formulário em seu site! Source: Fonte: AskDaveTaylor
Have any issues with this, post a comment and I’ll try to help! Ter qualquer problema com isso, posto um comentário e eu vou tentar ajudar! Enjoy! Apreciar!
If you enjoyed this post, make sure you Se você gostou deste post, certifique-se de subscribe to my RSS feed assinar o meu feed RSS ! !
» Filed Under »Arquivado em Google Software/Tips Google software / dicas
Related Posts Posts relacionados
- Create free website contact form without sharing your email address Criar livre site formulário de contato, sem partilhar o seu e-mail
- Guide to Creating Personalized Maps using Google My Maps Guia para criar mapas personalizados usando o Google Maps My
- How to add website shortcuts to the Windows Start Menu Como adicionar site atalhos para o menu Iniciar do Windows
- Google Search Tips - Shortcuts search methods Dicas de pesquisa do Google - Atalhos os métodos de busca
- Google Maps Traffic! O Google Maps tráfego!
























