Monday, March 28, 2011

Need a client-side interactive 2D world map: best map package? Or best C++ graphics/canvas library to make one?

I need a 2d political map of the world on which I will draw icons, text, and lines that move around. Users will interact with the map, placing and moving the icons, and they will zoom in and out of the map.

The Google Maps interface isn't very far from what I need, but this is NOT web related; it's a Windows MFC application and I want to talk to a C++ API for a map that lives in the application, not a web interface. Ideally I don't want a separate server, either, and any server MUST run locally (not on the Internet). What canned map package or graphics library should I use to do this? I have no graphics programming experience.

This is strictly 2D, so I don't think something like Google Earth or WorldWind would be appropriate. Good vector graphics support would be cool, and easy drawing of bitmaps is important.

All the canned options seem web oriented. SDL is about all I know of for flexible canvas programming, but it seems like making my own map would be a lot of work for what is probably a common problem. Is there anything higher level? Maybe there's a way to interact with an adobe Flash object? I'm fairly clueless.

From stackoverflow
  • You could extend your search by using the term GIS (Geographic Information System). I'm sure its gonna be easier. There's a lot of stuff out there on that subject.

    Here's a page I found: http://www.ucancode.net/Gis-Source-Code.htm

    or: http://opensourcegis.org/

    kingkongrevenge : Problem is that "GIS" seems to mean interacting with data on some sort server. All I want is a simple little static map of the world to draw on and animate.
  • Perhaps: http://www.codeplex.com/SharpMap

    ESRI MapObjects http://www.esri.com/software/mapobjects/index.html ESRI MapObjects LT http://www.esri.com/software/mapobjectslt/index.html

    See http://www.esri.com/software/mapobjectslt/about/mo_vs_lt.html for a comparison of the two MapObjects feature sets.

    ESRI may have a replacement to the MapObjects libraries

  • You might want to try the Mapnik C++/Python GIS Toolkit http://www.mapnik.org/.

    You can tale a look at the Marble Widget http://edu.kde.org/marble/#developers, which is part KDE's Marble project. There are Windows binaries for this, too, but they might be dependent on Qt.

  • Yes, Marble has also the advantage that it provides kind of a ready made solution in a single control (called "widget" in Qt's technical terms).

    The dependency on Qt (which is the only dependency btw.) might also be seen as an advantage: Qt's upcoming version is licensed under the LGPL, so even if you plan to use this in a proprietary application then there shouldn't be any real worries. And of course Qt and Marble are cross-plattform and provide an API that is very intuitive and easy to understand. Unlike common GIS solutions the Marble API and the usage of the widget is rather focused on people who don't know much about GIS. So its usage is quite easy to understand even if you feel scared by technical terms used in GIS.

    Marble offers several interfaces to programming:

    You can either create your own Marble plugins and paint inside those or you can subclass the MarbleWidget control. For a simple HelloWorld application see:

    http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

0 comments:

Post a Comment