Using Google Maps

Cristiano Giovando giovand at GMAIL.COM
Tue May 3 15:09:32 EDT 2005


Folks on the WW forum are using this script to proxy GMaps:

<?

$v_TileL = (int) $_GET['L'];
$v_TileX = (int) $_GET['X'];
$v_TileY = (int) $_GET['Y'];

$x = (int) $v_TileX;
$y = (int) (48 * (1 << $v_TileL) - $v_TileY - 1);
$tid = 't';
for ($i = 0, $l = 32 * (1 << $v_TileL); $i < ($v_TileL + 6); ++$i, $l >>= 1) 
{
if ($x & $l) {
if ($y & $l) $tid .= 's';
else $tid .= 'r';
} else {
if ($y & $l) $tid .= 't';
else $tid .= 'q';
}
}
header('Location: http://kh.google.com/kh?v=1&t=' . $tid);

?>

See the full thread at 
http://forum.worldwind.arc.nasa.gov/index.php?showtopic=2661&hl=google+maps

Let's see who's the first figuring out a WMS!

-C


On 5/3/05, Jeffrey Johnson <ortelius at gmail.com> wrote:
> 
> Has anyone figured out how to use Google Maps as a WMS server. I heard
> from a classmate that had, but we were unable to find any info online.
> 
> 
> On 5/3/05, Giridhar Manepalli <gmanepal at gmail.com> wrote:
> > Thanks Andy. I liked it. I still have to think about using that
> > somehow in the mapserver context.
> >
> > On 5/3/05, Andy Canfield <andy.canfield at gmail.com> wrote:
> > > To all,
> > > I have created an example of how to use Google Maps in your own web
> > > pages for routing, geocoding, directions etc. I have a sample web page 
> and
> > > all the code is within that page. I'm sure once folks see what I'm 
> doing
> > > they will be able to add it to their own Mapserver pages fairly 
> easily. I am
> > > going to try and add the page to this e-mail as a .zip file. If my 
> gmail
> > > strips it out please feel free to e-mail me and I will send you a copy 
> of
> > > the zip file from another account. The source will show you how to 
> feed an
> > > address to Google Maps and get back the Lat, Lon of that address. It 
> will
> > > also show how to feed Google Maps a from and to route request and get 
> back
> > > the directions and the polyline coordinates of the route. The source 
> code is
> > > intended as example only and I leave it up to you to how you want to 
> add
> > > that data to your Mapserver implementations. Google Maps does have
> > > restrictions to using their API so you must abide by them if you 
> decide to
> > > implement this example. If there are any errors in the source please 
> let me
> > > know so I can fix them. So far I have only tested this with Mozilla 
> and IE6.
> > > Thank you,
> > > Andy
> > >
> >
> 



-- 
Cristiano Giovando
Department of Geography
San Diego State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050503/e1518172/attachment.html


More information about the mapserver-users mailing list