views:

691

answers:

3

I want to display a map in a MFC application (Visual Studo 2008 with MFC Feature Pack). Off the top of my head I have the following requirements:

  • I have to be able to add my own markers (plain lat/lon positions), preferrably with different colors/icons so one can distinguish between different types of markers.
  • If the map data is fetched from an online source, it has to be cache-able, i.e. I can pre-load maps for an area at a certain (or several) zoom-level(s) and then switch to "offline mode". Alternatively all map data is installed together with the application.
  • The standard operations like zoom in/out and pan should be possible for the user.
  • The user has to be able to select my markers, preferably by dragging a rectangle around them.
  • Since the whole app is written in C++/MFC I don't want to have to use the .NET runtime for this plugin.
  • It shouldn't cost a fortune.

I am currently using an ActiveX plugin called "ESRI MapObjects LT2" which can do all that in some way but it's very tedious to implement, the development seems to have stopped around the time when Visual Studio 6 was available and map material is either very basic or very expensive.

I thought about using Google Maps or Google Earth but I think they don't really support being used by non-web based applications. I found ArcView to be some sort of successor of the plugin I use currently but I don't think I belong to the target audience since the functionality it offers is way more than what I need. Also I didn't find any information on pricing.

+1  A: 

Reconsider google if you have internet access. You can make an instance of the IE browser appear in a frame within your application. I believe you can use an ActiveX control. Also Google Earth has a way to embed itself into a web page, and possibly an application as well.

Another option is Global Mapper which is not anywhere near as nice as Google Maps or Google Earth.

We used ESRI for a long time before abandoning it due to a lack of performance and lack of support. It was such a big pain to pay $10k for a license, and then be told they need $2k more so that we can actually use the thing. Oh, and then $2k more to add some extra functionality. Even when it didn't work, their support was dismal to lack-luster.

Kieveli
Unfortunately it is essential that the whole thing works also without permanent internet access. The Google Earth app seems to allow caching up to 2GB of data but would that also be possible when using it as plugin?
mxp
+1  A: 

I have written an open-source Geocaching app ( it's in c++ ) that renders maps, the source is at:
http://code.google.com/p/gpsturbo/

It uses my own custom rendering but you could rip out the map parsing if you want. It renders map using google tiles ( and caches the tiles for offline use), as well as Garmin format GPS maps, there is also an Openstreetmap format renderer as well.

KPexEA
+1  A: 

If you are not bound to Google Maps, you could choose OpenStreetMap.

There are couple of known applications for rendering OSM maps:

First two render map directly, last one uses OpenStreetMap.org tiles.

You can cache as many tiles or data as you want, you are not restricted to do so.

Igor Shubovych