LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-14-2009, 12:27 PM   #1
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Rep: Reputation: 30
Google Maps - how it works?


Hello,

I'm wondering how Google Maps work. I'd like to do similar thing in
Lazarus (Delphi in Linux). In Google Maps map of whole world is
divided to squares. I'd like to create matrix of images 3 rows, 3 columns and be able to zoom in and out, pan and have uniform
pixel numbers through this matrix. With what algorithm can I achieve it?.

Cheers.

Last edited by mac1234mac; 08-14-2009 at 03:03 PM.
 
Old 08-15-2009, 10:10 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
If you restrict the zoom (as Google does) to certain factors (eg following the sequence 1,2,5,10,20,50,100,200,500, etc or just 1,2,4,8,16,32 etc), you make the job simpler.

This means that the zoom and pan is always aligned to the pixels (though you have to skip pixels as you zoom out).

Google also have more than one level of imaging; if you zoom through the levels, you will notice changes from one set to another at some of the levels.

Give that the most storage is used by the deepest zoom level, it doesn't actually cost much more to generate/store the map at every zoom level (rather than have a single data structure). For an extra 30% storage, you can store all the zoom levels. Though this assumes that the map is not dynamically changing.

So I'd suggest for a start that you just have a simple pixel map at the deepest zoom level, with an x and y offset and zoom level. As you zoom out, the zoom level will increase (1,2,5,10,20,50, etc). The pan rate is directly proportional to this zoom level. And when you are generating the zoomed out content, the zoom level also is the step size for selecting pixels (or groups of pixels).

If you need something more sophisticated (arbitrary zoom/angles, 3D imaging), then it is worth reading an introductory book on 3D graphics, covering topics such as mipmaps.

Last edited by neonsignal; 08-15-2009 at 10:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
regd GTK widgets to access google maps thilaga Linux - Newbie 0 04-22-2009 04:36 AM
LXer: Google Maps and Google Earth KML overlays LXer Syndicated Linux News 0 10-29-2008 04:30 AM
Force Squid to Cache maps.google.com? esaym Linux - Networking 1 01-11-2007 04:59 PM
Showstopper bug in google maps... bulliver General 7 09-29-2006 09:38 AM
Google Maps not working in Firefox? clausawits Fedora 2 02-09-2005 06:11 AM


All times are GMT -5. The time now is 06:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration