views:

2874

answers:

6

Hi,

I am trying to create a wpf control that will display a map image using google maps. I want to be able to centre the map on a longitude and latitude specified by the application. Ideally, the control will then allow the user to move a map marker and store the latitude/longitude of the marker in the application.

The only way I can think of doing this is to use a WebBrowser control and create a HTML string at runtime that shows a map of the desired location. This seems like an awkward solution and won't allow me to easily retrieve the marker location. Does anyone know of a better way to accomplish this?

A: 

I'm not 100% sure on this, but I think that doing something like that would violate Google Map's Terms of Service.

viggity
Yes, I have looked into it more closely and it is against the terms. I'm now looking around for an alternative map api that would be suitable.
Dave Turvey
Ash Kim
from http://code.google.com/apis/maps/terms.html section 9.1 says it must not be accessible only to an internal network. The app is an internal business app so the api wouldn't be appropriate.
Dave Turvey
This sample is from the Google Maps documentation, posted in March 2009 by Marc Ridey, Google Geo Team.http://code.google.com/apis/maps/articles/flashmapinwpf.html
Maghis
A: 

There is a nice integration between windows forms and Microsoft Virtual Earth (sample here.) There are licensing considerations for commercial products, but this is certainly more or a "turnkey" option. You would also need to look into the Windows Forms Host to put a Forms control into a WPF app.

Barry Fandango
+2  A: 

http://greatmaps.codeplex.com/

radioman
this looks very good...
Schneider
+3  A: 

Hosting Google Maps in a Microsoft WPF application using XAML http://code.google.com/apis/maps/articles/flashmapinwpf.html

A: 

its possible see the sample application

http://goldymanikoth.blogspot.com/2010/03/goole-map-wpf-windows-application.html

Goldy
A: 

I have tried the google maps (http://code.google.com/apis/maps/articles/flashmapinwpf.html) stuff on XP and it works fine, but on Windows 7 I get a threading exception as the map is initialized. I think it's got something to do with how the container is hosted. Has anyone got this running on Windows 7?

Actually, it was because I was targeting "any CPU" and the 64-bit OS didn't like the flash interop, so I had to target x86 in the project build settings.