Click here to Skip to main content
6,822,123 members and growing! (15,835 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » Windows Forms     Advanced License: The MIT License

GMap.NET - Great Maps for Windows Forms & Presentation

By radioman.lt

GMap.NET is a powerful, Free, cross platform, open source .NET control. Enable use routing, geocoding and maps from Google, Yahoo!, OpenStreet in Windows Forms & Presentation, supports caching!
C#.NET2.0, Mono, .NET3.0, GDI, GDI+, ADO.NET, WPF, WinForms, Architect, Dev, Design
Revision:8 (See All)
Posted:18 Jan 2009
Updated:31 Jan 2009
Views:56,295
Bookmarked:231 times
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
54 votes for this article.
Popularity: 7.69 Rating: 4.44 out of 5
3 votes, 5.6%
1
2 votes, 3.7%
2
3 votes, 5.6%
3
6 votes, 11.1%
4
40 votes, 74.1%
5
GMapNET/GMapNETv7cp.PNG

Introduction

Google maps are cool, yeah? But it's useful only in browser and is insufficient for real time tracking. It also does not have cache so Google servers are overloaded. This control removes all these deficiencies! It also gives the .NET developer unlimited ability to extend it!

Background

The basic idea is simple: get the required data from Google, cache it, and use it. Fast, simple and practical.

Using the Code

It's more than easy. GMap.NET.dll contains the user control. Add it to your project and simply use it.

Basic control initial options:

// render mode, can be GDI/GDI+
MainMap.RenderMode = GMapRenderMode.GDI;

// cache usage
MainMap.UseTileCache = true;
MainMap.UseRouteCache = true;
MainMap.UseGeocoderCache = true;

// map type, map/satellite/terrain
MainMap.MapType = GMapType.Map;
MainMap.Zoom = 13;
MainMap.Language = "lt";

// set initial map coordinates in Latitude,Langtitude
MainMap.CurrentPosition = new PointLatLng(54.6961334816182, 25.2985095977783);

// for advanced, we can set events
MainMap.OnCurrentPositionChanged += 
	new GMapControl.CurrentPositionChanged(MainMap_OnCurrentPositionChanged);
MainMap.OnTileLoadStart += new GMapControl.TileLoadStart(MainMap_OnTileLoadStart);
MainMap.OnTileLoadComplete += 
	new GMapControl.TileLoadComplete(MainMap_OnTileLoadComplete);

// load map on main form shown
private void MainForm_Shown(object sender, EventArgs e)
{
   MainMap.ReloadMap();
}

As you can see, control options are quite simple. And there is nothing more to add.

Points of Interest

Well, it was quite cryptic to figure out how Google manages tiles, what coordinate system it uses, JSON decryption, etc.

History

Go to the project's CodePlex site to get a running update of any changes or improvements I've made.

License

This article, along with any associated source code and files, is licensed under The MIT License

About the Author

radioman.lt


Member

Occupation: Software Developer
Location: Lithuania Lithuania

Other popular Miscellaneous articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 132 (Total in Forum: 132) (Refresh)FirstPrevNext
GeneralBlank Screen PinmemberMember 176238913hrs 37mins ago 
GeneralRe: Blank Screen Pinmemberradioman.lt13hrs 27mins ago 
GeneralGreat article!! Pinmembervsaratkar10:49 18 Jan '10  
GeneralRe: Great article!! Pinmemberradioman.lt10:56 18 Jan '10  
GeneralStreetView using GMap.net Pinmembervsaratkar11:42 5 Jan '10  
GeneralRe: StreetView using GMap.net Pinmemberradioman.lt11:54 5 Jan '10  
GeneralRe: StreetView using GMap.net Pinmembervsaratkar4:55 7 Jan '10  
GeneralHow to get direction from one location to another Pinmembervsaratkar11:51 4 Jan '10  
GeneralRe: How to get direction from one location to another Pinmemberradioman.lt20:22 4 Jan '10  
GeneralRe: How to get direction from one location to another Pinmembervsaratkar4:05 5 Jan '10  
QuestionError while coverting the route results with KmlType [modified] Pinmemberrmpandu22:45 26 Aug '09  
AnswerRe: Error while coverting the route results with KmlType Pinmemberradioman.lt23:10 26 Aug '09  
GeneralRe: Error while coverting the route results with KmlType Pinmemberrmpandu22:18 27 Aug '09  
GeneralError on loading Map PinmemberKashif Usman0:47 20 Aug '09  
GeneralRe: Error on loading Map Pinmemberradioman.lt2:07 20 Aug '09  
GeneralRe: Error on loading Map PinmemberKashif Usman18:31 20 Aug '09  
QuestionUsing the core in a Windows Service PinmemberDrJaymz6:54 3 Jun '09  
AnswerRe: Using the core in a Windows Service Pinmemberradioman.lt10:54 3 Jun '09  
GeneralRe: Using the core in a Windows Service PinmemberDrJaymz0:11 4 Jun '09  
GeneralRe: Using the core in a Windows Service Pinmemberradioman.lt0:18 4 Jun '09  
GeneralRe: Using the core in a Windows Service PinmemberDrJaymz5:53 5 Jun '09  
GeneralRe: Using the core in a Windows Service Pinmemberradioman.lt6:58 5 Jun '09  
GeneralRe: Using the core in a Windows Service Pinmemberradioman.lt9:55 5 Jun '09  
GeneralRe: Using the core in a Windows Service PinmemberDrJaymz13:01 5 Jun '09  
GeneralRe: Using the core in a Windows Service Pinmemberradioman.lt13:11 5 Jun '09  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.

PermaLink | Privacy | Terms of Use
Last Updated: 31 Jan 2009
Editor: Deeksha Shenoy
Copyright 2009 by radioman.lt
Everything else Copyright © CodeProject, 1999-2010
Web21 | Advertise on the Code Project