How to draw a circle on a map?

Creating a control that will allow a user to draw a circle on a map and return the zip codes found in that circle

  • I am working on Windows Forms C# .Net 4.0 application and have a request to create a controls that: Displays a map, hopefully current from Google Maps/Bing etc. that will allow the user to scroll and zoom Allows a user to draw a shape on the this map, a circle at a minimum but a square or free form would be nice Return the zip codes found in that shape for use by the application I have been searching for .net map controls and most refer to asp.net controls, of the ones that seem to be for windows (GMap.net, SharpMap) it is not clear to me that I can do what I am trying to with these libraries. An opensource would be nice but buying a licence is not out of the question. Anyone who can point me in the right direction would be appreciated.

  • Answer:

    I ve done something similar by combining Gmap.Net with google maps api for .NET (http://gmaps.codeplex.com/) I already posted a way to draw a shape here http://stackoverflow.com/questions/9308673/how-to-draw-circle-on-the-map-using-gmap-net-in-c-sharp It can be easily be adjusted to draw free form polygons (with the respective mouse click events) as far as quering the google maps api to get post codes ect it might be proved tricky with shapes (especially freeform ones) generally the idea on how google maps api for .net works is this private void findadd(string addstring) { var request = new GeocodingRequest(); request.Address = addstring; request.Sensor = "false"; var response = GeocodingService.GetResponse(request); }

Matthew Bierman at Stack Overflow Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.