VB NET Windows Application with Maps


I would like some advice on creating a windows application that includes Maps where users can search for locations and generate directions between locations.

Currently I have created the app with a web browser that points to Google maps where the user can then enter the information required. However, this also includes all the extras that comes with the website, which I don't really want.

The next approach could be to add a mapping API, preferably Google but I need it to be free... Is this possible? If so how should I start.

The app that I am creating is for internal business use, for basically locking down a PC so the users can only use the mapping website.

Thanks, Greg
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
We can use below..Google API  ...you can get upto 25k maps per day.
you also have to register for it to get the key.


you can convert the c# above from below to VB.NET

spen_langAuthor Commented:
OK thanks, I thought it was only free for Android Apps?
Pawan KumarDatabase ExpertCommented:
See the entire collection from google.


Google Maps Android API
Google Maps Directions API
Google Maps Distance Matrix API
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Or use the Bing maps extention in Visual studio:
I've used this a few times, and it's very quick and easy to implement.  On web apps I pretty much always use Google, but for windows apps I always pick the Bing control, as the native integration is far smoother and better than embedding a webbrowser.

If you're using WinForms and not WPF, you can still jump through a couple hoops to put a WPF control in,

Basic Bing key is free, but the request limits are lower than Google.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
spen_langAuthor Commented:
Thanks Snarf0001, do you have any examples or places to start?
Best place would be here to start:

Runs you through getting a key, what you need, and creating the first app.
Links to full development resources / docs as well.
spen_langAuthor Commented:
Hi, how do I add this to an existing Windows App? I have tried adding a new User Control (WPF) but when I then try to add teh control to a new Windows Form in my existing app I get teh error: "Value cannot be null. Parameter name: objectType".

<UserControl x:Name="BingMaps" x:Class="BingMaps"
             d:DesignHeight="300" d:DesignWidth="300">
        <m:Map CredentialsProvider="MyKey" Mode="AerialWithLabels" />

Open in new window

How did you add the control, did you try to add it directly or through an ElementHost?
If you can post more code I can try to see what the problem is, just made a quick and dirty WinForm version myself and it worked properly, so would need more details from you.

Even stacktrace and inner exceptions from the error you mentioned would help.
spen_langAuthor Commented:
Thank you, I have just this moment worked it out, I forgot to rebuild my app before adding the WPF ElementHost and therefore it was still referencing the older WPF control I created.
spen_langAuthor Commented:
How would I do this within the control?

 Public Sub New()
        'Set the map mode to Aerial with labels
        myMap.Mode = New AerialMode(True)
    End Sub
Exactly like you have it should work.

Both within the xaml like you had earlier, "<m:Map CredentialsProvider="MyKey" Mode="AerialWithLabels" />", as well as the code snippet directly above "myMap.Mode = New AerialMode(True)".

What's not working?
spen_langAuthor Commented:
Is It possible to add the "directions" feature to the map control?

For example I would like users to be able to search the map for places and get direction between two locations...

Thanks, Greg
Yes, you need to use the "Routes API" for that.

Once you get the data, you can draw on the map with Polylines, and display the text steps however you see fit.

Link with a bit more detail (for silverlight, but basically the same thing):

One important thing to note, when you're using the rest services, make sure you initialize the call with the map's SESSION key as outlined here (Making use of Sessions):

Otherwise you'll incur more instance charges since it thinks each one is a new request.
spen_langAuthor Commented:
Both comments helped
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.