After looking (Googling) on the web for a while, I can find nothing that takes an address like:
1200 Pennsylvania Ave SE, Washington, District of Columb
What about this : http://support.google.com/maps/bin/answer.py?hl=en&answer=72644
I know I'm very late to the game, but thought I'd contribute for posterity's sake.
I wrote a short jQuery function that will automatically turn any <address>
tags into Google maps links.
See a demo here.
$(document).ready(function () {
//Convert address tags to google map links - Michael Jasper 2012
$('address').each(function () {
var link = "<a href='http://maps.google.com/maps?q=" + encodeURIComponent( $(this).text() ) + "' target='_blank'>" + $(this).text() + "</a>";
$(this).html(link);
});
});
I also came across a situation that called for generating embedded maps from the links, and though I'd share with future travelers:
View a full demo
$(document).ready(function(){
$("address").each(function(){
var embed ="<iframe width='425' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&q="+ encodeURIComponent( $(this).text() ) +"&output=embed'></iframe>";
$(this).html(embed);
});
});
How about this?
https://maps.google.com/?q=1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003
https://maps.google.com/?q=term
If you have lat-long then use below URL
https://maps.google.com/?ll=latitude,longitude
Example: maps.google.com/?ll=38.882147,-76.99017
UPDATE
As of year 2017, Google now has an official way to create cross-platform Google Maps URLs:
https://developers.google.com/maps/documentation/urls/guide
You can use links like
https://www.google.com/maps/search/?api=1&query=1200%20Pennsylvania%20Ave%20SE%2C%20Washington%2C%20District%20of%20Columbia%2C%2020003
The best way is to use this line:
var mapUrl = "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=16900+North+Bay+Road,+Sunny+Isles+Beach,+FL+33160&aq=0&sll=37.0625,-95.677068&sspn=61.282355,146.513672&ie=UTF8&hq=&hnear=16900+North+Bay+Road,+Sunny+Isles+Beach,+FL+33160&spn=0.01628,0.025663&z=14&iwloc=A&output=embed"
Remember to replace the first and second addresses when necessary.
You can look at work sample
Feb, 2016:
I needed to do this based on client entered database values and without a lat/long generator. Google really likes lat/long these days. Here is what I learned:
1 The beginning of the link looks like this: https://www.google.com/maps/place/
2 Then you put your address:
3 Put the address after the place/
4 Then put a slash at the end.
NOTE: The slash at the end was important. After the user clicks the link, Google goes ahead and appends more to the URL and they do it after this slash.
Working example for this question:
https://www.google.ca/maps/place/1200+Pennsylvania+Ave+SE,+Washington,+DC+20003/
I hope that helps.
On http://www.labnol.org/internet/tools/short-urls-for-google-maps/6604/ they show a short URL that works pretty well
Google Maps URLs are pretty unwieldy especially when sending over an IM, tweet or email. MapOf.it provides you a quick way to link to Google Maps by simply specifying the address of the location as a search parameter.
http://mapof.it/
I used it for a few applications I've designed and it worked like a charm.