http://www.google.com/lochp?hl=en&tab=wl&q=33.4155763733%2C-86.7390106627
http://www.google.com/lochp?hl=en&tab=wl&q=33.4155763733%2C-86.7390106627&t=k
You can specify both zoom and lat/long in the query string...
The parameter for zoom is simply "z".. so:
http://maps.google.com/?sll=37.616%2C-115.816&z=10
You can put latitude and longitude of any place in the world this way:
http://maps.google.com/maps?q=&ll=latitude_here,longitude_here&spn=0.043259,0.061455&t=k&hl=en
You can actually do all kinds of neat stuff with the URLs for Google maps other than
just embed the lat and lon. Here is a sample URL:
http://maps.google.com/maps?q=45.895638+-66.589333+(Capital+City+Paintball)&spn=0.05,0.05&hl=en&t=0&iwloc=A
and here are the parts:
lat and lon: q=45.895638+-66.589333
Comment for info window: (Capital+City+Paintball)
Zoom Level (width of map): &spn=0.05,0.05
language of map (en=english, fr=french): &hl=en
map type (0=street map, k=satellite, h=hybrid): &t=0
Info window status (A=open, B=closed): &iwloc=A
One hack to get google maps to display a marker at a given latitude and longitude
is to ask google for driving directions with from and to being the same place:
http://maps.google.com/?q=from+40.09086%2c-82.95061+to+40.09086%2c-82.95061
-----------------------------------------------------------
So, after hours of coding and scouring the google source code...here is the code for
getting the latest coordinates for the tiles based on lat & lon:
first we need to fill a few arrays
c = 256
for (d=17;d>=0;--d) {
pixelsPerLonDegree[d] = c / 360
pixelsPerLatDegree[d] = c * (2 * Math.Pi)
e = c / 2
bitmapOrigin[d] = New Point(e,e)
c*=2
}
after we fill this we can get the coordinates by plugging in
d = New Point(0,0)
d.X = Math.Floor(bitmapOrigin[zoom].x + lon * pixelsPerLonDegree[zoom])
e = Math.Sin(x * (Math.Pi/180))
if (e > .9999) e = .9999
if (e < -.9999) e = -.9999
d.Y = Math.Floor(bitmapOrigin[zoom].y + .5 * Math.Log((1+e) / (1-e)) * -pixelsPerLonRadian[zoom])
d.X = Math.Floor(d.x / 256) //tileSize
d.Y = Math.Floor(d.y / 256)
d.X = the bitmaps X value, d.Y = bitmaps Y value
//sorry
e = Math.Sin(x * (Math.Pi/180) shoudl read...
e = Math.Sin(lat * (Math.PI / 180))
---
It works if you change the address form:
http://mt.google.com/mt?v=.1&x=1034&y=35&zoom=4
To this:
http://mt.google.com/mt?v=.3&x=1034&y=35&zoom=4
I only change the 'v' value. I think the v is the version.
---
While I was searching for program like mine I found a lot of requests for
function converts latitude and longitude to image number for kh.google.com.
I was surprised, because it's trivial (please do not comment my style, I
knowingly write "easy to read" code here):
sub latlon2xy {
my $x = shift;
my $y = shift;
my $zoom = shift;
my $divx = 2**($zoom-1);
my $divy = 2**$zoom;
my $stepx = 360 / $divx;
my $stepy = 720 / $divy;
my $vx = (180 + $x)/$stepx + $divy/2;
my $vy = (180 + $y)/$stepy;
return sprintf("%.0f", $vy), sprintf("%.0f", $vx);
}
---