Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (554)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Understanding Google Map server (Update)  (Read 3155 times)
0 Members and 1 Guest are viewing this topic.
Offline DzzD
« Posted 2007-12-12 16:08:41 »

EDIT:
url have been updated as old one did not work anymore

Here is an explanation on how google map server works, it took me some time to undertand it, when i finnaly found that it is really simple!

google map server "http://kh1.google.fr/"  http://kh0.google.com/kh or "http://kh1.google.com/" http://kh0.google.fr/ or etc... is a quadtree of 256*256 jpg:

NB: I play by computing and approximation of number of jpg handled by google maps server about 2*4^19 jpg(256*256) or 2^39!!

Lets look at the following url:
http://kh1.google.fr/kh?v=20&t=tq
new URL


explanation of parameter:
v : length of t parameter can be higher but cannot be lesser than t parameter lenght (so you can let it to 20)
t : jpg location in the quad tree begining with "t"

The above url t parameter means:
first jpg of the first tree level "q"
second jpg of the first tree level "r"
third jpg of the first tree level "s"
fourth jpg of the first tree level "t"

how it is divided:
QR
TS

each level is than subdivided in 4 same way:
http://kh1.google.fr/kh?v=20&t=tqq
http://kh0.google.com/kh?v=3&t=tqq
qq means first sub jpg of the first jpg

you may better understand with this picture :


So to have the first quarter of the earth:
http://kh1.google.fr/kh?v=20&t=tq
http://kh0.google.com/kh?v=3&t=tq



and the first quarter of the first quarter:
http://kh1.google.fr/kh?v=20&t=tqq
http://kh0.google.com/kh?v=3&t=tqq




it is easy to convert latitude and longitude to quarter you can see a demo online there:
http://demo.dzzd.net/GMAP/

have fun!


EDIT:
If you are interrested in the demo source code just right click on your browser and select view source there is no outside files, the whole source including jscript is in the the html source code.

Offline kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2007-12-12 16:27:47 »

s and t are the wrong way round on the top level of your diagram.

Neat stuff tho! Smiley

Kev

Offline DzzD
« Reply #2 - Posted 2007-12-12 16:46:50 »

oups... fixed, thanks

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline thijs

Junior Member




Lava games rock!


« Reply #3 - Posted 2007-12-13 11:16:31 »

Nice work Bruno!

Time to start using this for streaming LOD textures for our 3D Earth demo dont you think? Wink

<a href="http://www.dzzd.net">3DzzD!</a>
<a href="http://www.arcazoid.com">Arcazoid!</a>
Offline DzzD
« Reply #4 - Posted 2007-12-15 17:45:18 »

Quote
Time to start using this for streaming LOD textures for our 3D Earth demo dont you think?

inded it could be really cool a google earth lite edition working with JVM 1.1.

but dont really know if those image can be used , google show images in its search engine image section so i guess if they do (showing image from other servers) I thing we should be able to do the same and use image from google map server ?

anyways it would really cool

Offline DzzD
« Reply #5 - Posted 2007-12-15 20:05:07 »

ps.: I forgot to mention this url http://kh1.google.com/kh?v=20&t=t

wich show the whole earth map (zoom=0)

Offline SimonH
« Reply #6 - Posted 2007-12-18 02:05:55 »

This is great! Hours of fun  Smiley
BTW Is there a simple system for converting longitute/latitude to 'http://kh1.google.com/kh?v=20&' format?

People make games and games make people
Offline DzzD
« Reply #7 - Posted 2007-12-18 10:37:20 »

yup just look at the html source code of the given demo link in the first post, all the jscript is inside, it is easily convertible to any other language.

Edit:

this one, right click qnd select "view html source code"
http://demo.dzzd.net/GMAP/

Offline DzzD
« Reply #8 - Posted 2009-07-09 00:52:48 »

seems that something was changed google side, so  I have update this post with the new working URL (old one did not work anymore), online sample has also been updated :  http://demo.dzzd.net/GMAP/ )

have fun

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (18 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (70 views)
2014-08-11 02:49:23

BurntPizza (47 views)
2014-08-09 21:09:32

BurntPizza (38 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!