4 Replies - 5044 Views - Last Post: 04 May 2012 - 01:03 PM Rate Topic: -----

#1 ikevin09  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 12-September 11

Geocode with google api in windows form application

Posted 03 May 2012 - 09:21 PM

Hi guys,

I currently have the map control hard coded its center with the following coordinate:
gmap.Center = new GeoPointImpl(40.714728, -73.998672);


but I want to send the address to Google's geocoding service for the coordinates to replace those coordinates above. How can I do it? I saw some examples online but it's too confusing to read, since I started C# about 3 weeks ago. :dontgetit:

Is This A Good Question/Topic? 0
  • +

Replies To: Geocode with google api in windows form application

#2 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6508
  • View blog
  • Posts: 14,375
  • Joined: 02-June 10

Re: Geocode with google api in windows form application

Posted 03 May 2012 - 09:28 PM

Let me be blunt: We don't care if your program works. We only care that you learn your craft.

We won't give you code that you don't understand, or that you won't make the effort to understand, or that is so far beyond your current skill level that you can't understand. We're not here to write your code for you to simply copy/paste into your application.

If you aren't grasping an API that millions of others are using, then you aren't ready to move forward to this level of coding. Stick with learning the language and underlying concepts and revisit the API in 3 months.

There are three routes people seem to take when learning programming.
  • Just start trying to create programs
  • Start taking apart other programs and try to figure out the language by reverse engineering
  • Follow a guided learning course (school or self-teaching books)


For the life of me I can't figure out why people try 1 & 2.
Sure, 35 years ago the only way I could learn BASIC as a kid was to type programs from a book into a TRS-80 model 1 or Commodore VIC-20, then figure out the commands and syntax by watching the results as the program ran. There simply wasn't any courses for a kid back then.

But now, you can't help but to trip over "Learn {coding language} in 3 weeks" type books and the entire internet is at your disposal for tutorials.

I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.


If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Mar 2012
Spoiler

Was This Post Helpful? 0
  • +
  • -

#3 ikevin09  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 12-September 11

Re: Geocode with google api in windows form application

Posted 03 May 2012 - 09:40 PM

I'm not forcing myself to do something which is far beyond my level, this is a class project that I am forced to do using C#... I didn't have a choice, sorry.

By the way, I wasn't asking for you guys to write out the program for me, instead, I asked "how" to do it. Just a little tip and I can move from there.
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1533
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Geocode with google api in windows form application

Posted 04 May 2012 - 06:00 AM

So tell us what you are having a problem with. "Too confusing to read" tells us nothing.

From the looks of it, you simply make a call to the Google API. The "GeocodingResponses" basically gives you the correct URL, you just need to change the address.

https://developers.g...codingResponses

So what are you having a problem with?
Was This Post Helpful? 0
  • +
  • -

#5 ikevin09  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 12-September 11

Re: Geocode with google api in windows form application

Posted 04 May 2012 - 01:03 PM

I'm trying to figure out how does the request returns the coordinates.

For example if I send out the xml request:
http://maps.googleap...theatre+Parkway,+Mountain+View,+CA&sensor=true_or_false

I have to scan through the response by using xmltextreader? Once it found "Latitude" and "Longitude", then assign the values from the response to proper variable?


EDIT: I was right (finally figured out the method), got the geocode working :) thanks guys

This post has been edited by ikevin09: 04 May 2012 - 01:15 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1