tags:

views:

58

answers:

1

I want to write a program for UNIX in C++ with GUI (planning it to be Qt). I haven't learned the Qt library yet btw. I want the program to be like a world map that will be divided into many cells like a grid(the grid shouldn't be visible) and when i start to ping some IP it will show me that IP location on the world map (select it like a highlight dot or something). The part for the ip discovery is finished and it successfully locates the location of the ip (via whois). Now what remains is the Gui part, which i guess is not that easy.

So i was looking for any ideas how to do the task ? Whoever had experience with similar issue - please write your suggestions and advices, or maybe some nice snippets of code.

A: 

It actually is pretty easy. Using Qt and its GraphicsView framework. Just display a big world map and draw a dot where you want.

However, converting lon:lat coordinates to x:y needs some basic maths (you can find formulaes by googling. It will depend on the projection of your map).

Another possiblity is to use existing map tiles (like from openstreet map). Look at http://labs.trolltech.com/blogs/2009/08/04/openstreetmap-and-qt-and-s60/ http://labs.trolltech.com/blogs/2009/07/29/maps-with-a-magnifying-glass/

Have fun!

Tristram Gräbener