Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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 2812 times)
0 Members and 1 Guest are viewing this topic.
Offline DzzD
« Posted 2007-12-12 17: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #1 - Posted 2007-12-12 17: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 17:46:50 »

oups... fixed, thanks

Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline thijs

Junior Member




Lava games rock!


« Reply #3 - Posted 2007-12-13 12: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 18: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 21: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)

Online SimonH
« Reply #6 - Posted 2007-12-18 03: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?

Heroes' Keep is in development.
Meanwhile try Bloodridge
Offline DzzD
« Reply #7 - Posted 2007-12-18 11: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 02: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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (77 views)
2013-05-17 21:29:12

alaslipknot (89 views)
2013-05-16 21:24:48

gouessej (120 views)
2013-05-16 00:53:38

gouessej (113 views)
2013-05-16 00:17:58

theagentd (126 views)
2013-05-15 15:01:13

theagentd (113 views)
2013-05-15 15:00:54

StreetDoggy (156 views)
2013-05-14 15:56:26

kutucuk (179 views)
2013-05-12 17:10:36

kutucuk (179 views)
2013-05-12 15:36:09

UnluckyDevil (186 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.107 seconds with 20 queries.