Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8205131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:07:05+00:00 2026-06-07T08:07:05+00:00

The address I have is a concatenated results[1].formatted_address retrieved from a database containing 6

  • 0

The address I have is a concatenated results[1].formatted_address retrieved from a database containing 6 numbers e.g 530456. I then geocoded it and placed a marker on a google map. This part is successful.

I now want to display the full address, results[0].formatted_address in a infowindow of the marker, so what I did was to reverse geocode the latLng of the marker to obtain the full address but caused the entire map to disappear. The way I did it is as such:

var address;
var eventwindow;
function codeAddress(postal) {
    geocoder.geocode( {'address': postal + ", Singapore"}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        eventwindow = new google.maps.InfoWindow();
        var markerE = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location,
        });

        address = getMarkerAddress(results[0].geometry.location);

        google.maps.event.addListener(marker, 'click', function(){
            if(eventwindow)
                eventwindow.close();
            eventwindow = new google.maps.InfoWindow({
                content: address,
            });
            eventwindow.open(map,marker);
        });
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    });
  }

function getMarkerAddress(location) {
    geocoder.geocode({'latLng': location}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
          if(results[0])
          {
            address = results[1].formatted_address.substring(10);
          }
        }
       else {
        alert("Geocoder failed due to: " + status);
      }
    });

I don’t know if I’m doing this right and and not sure where I went wrong. Is there another way to this problem? If so how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:07:07+00:00Added an answer on June 7, 2026 at 8:07 am

    I don’t know if I’m doing this right and and not sure where I went wrong. Is there another way to this problem? If so how?

    If you know the “correct” address, use that. You haven’t provided enough details of your application to make suggestions on how to do that. You can avoid the uncertainty of the geocoder by storing the coordinates that are returned from the geocoder in your database along with the address, then if you find an error, you can fix it.

    This article on geocoding strategies might help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an address database and I tried to find latitude and longitude using
I have a database with Points of Interest that all have an address. I
Have a group of email address and numbers together that are taken out of
I have a string containing address and a phone number (US format; (xxx) xxx-xxxx).
I have a view where I have the user select a email address from
i am trying to get a random string from database i have tried to
I have address table in which city field have nvarchar datatype, but I want
I am new to iphone development. In my application, I have address for a
I have a address like line = 12345 North Drive,,Palm Retreat, CO,CO,92261 When I
I have an address finder system whereby a user enters a postcode, if postcode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.