www.webdeveloper.com
Results 1 to 3 of 3

Thread: Google Geocoding

  1. #1
    Join Date
    Nov 2010
    Posts
    2

    Google Geocoding

    Hi there,

    I know too little of JavaScript to get the Google Maps API working.
    I hope someone can help me out!

    My goal is to display an address.
    In the example on google, you can input it through a form:
    http://code.google.com/apis/maps/doc...ng-simple.html

    I would like the map to show the location+marker when I open the page, not after clicking a submit button.
    However, I only want an address in my html. I want the API to convert it in a LatLng format.

    Hopefully, someone can take the time to look at it.
    It's all in the source code of the page mentioned above, I believe.

    Thanks!

  2. #2
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    373
    Quote Originally Posted by jorikkoppert View Post
    Hi there,

    I know too little of JavaScript to get the Google Maps API working.
    I hope someone can help me out!

    My goal is to display an address.
    In the example on google, you can input it through a form:
    (url)http://code.google.com/apis/maps/doc...mple.html(/url)
    I could not reach your example. Try (url=http://www etc, full name.html)What you want to show(/url). Quote this message and look at the bottom of it for an example.
    I would like the map to show the location+marker when I open the page, not after clicking a submit button.
    However, I only want an address in my html. I want the API to convert it in a LatLng format.

    Hopefully, someone can take the time to look at it.
    It's all in the source code of the page mentioned above, I believe.
    There is a google forum to discuss these types of questions, but I never got that deep. This is some code to reference a working page:
    Code:
    function doMap() {
    var newlink;
    if (lat1.NaN || lon1.NaN || lat2.NaN || lon2.NaN) {
      alert ("Run distance function first");
      return 1; }
    newlink = "http://www.movable-type.co.uk/scripts/latlong-map.html?lat1=" + lat1 + "&long1=" + lon1 + "&lat2="
            + lat2 + "&long2=" + lon2 ;
    self.location.href = newlink;		
    }
    It is from my gps page.

  3. #3
    Join Date
    Nov 2010
    Posts
    2
    OK, a retry for the Simple Geocoding example.

    If you look at the source, you see two functions:
    initialize() & codeAddress()
    In the first, you have to enter the LatLng value, but in the second function that value is retrieved by
    Code:
    map.setCenter(results[0].geometry.location);
    That's what I make of it. Any way of getting that value on the page load and using it to generate the map?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles