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 8358833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:55:51+00:00 2026-06-09T10:55:51+00:00

I am using google map API 3 and google geocoder. The problem is It’s

  • 0

I am using google map API 3 and google geocoder. The problem is It’s not showing the marker and info window I am bringing the data by ajax and calling a function showAddress(elemId, address) Where elementId is div id where the map will be rendered. Here the code for the google map

<script type="text/javascript">
//<![CDATA[

var geocoder;
var map;
var lat;
var lng;
function showAddress(elemId, address) {
    geocoder = new google.maps.Geocoder();
    geocoder.geocode( { 'address': address}, function(results, status){
//        console.log(results[0].geometry.location.YA);
            lat = results[0].geometry.location.Ya;
            lng = results[0].geometry.location.Za;
                var mapOptions = {
                    zoom: 15,
                    center:  new google.maps.LatLng(lat, lng),
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                };
            map = new google.maps.Map(document.getElementById(elemId),
                    mapOptions)
            $('a#full-'+elemId).attr('href','http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q='+lat+','+lng+'')
            var marker 
            marker = "marker_"+elemId;
            myLatlng = new google.maps.LatLng(lat,lng);
            marker = new google.maps.Marker({
                id:elemId,
                position: myLatlng,
                map: map
            });
            var infowindow = "infowindow"+elemId;
            infowindow  = new google.maps.InfoWindow({
            content: 'Hello world'
            });
            infowindow.open(map, marker);
            google.maps.event.trigger(map, 'resize');
    });

}
</script>
  • 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-09T10:55:53+00:00Added an answer on June 9, 2026 at 10:55 am

    First of all .Ya and .Za are not documented properties so if you use them as in

    lat = results[0].geometry.location.Ya;
    lng = results[0].geometry.location.Za;
    

    that code is likely to break.

    secondly, results[0].geometry.location is already a google.maps.LatLng() object, so there is no need to extract the lat and lng separately and create a new one. You can just use it like:

    map.setCenter(results[0].geometry.location);
    var marker = new google.maps.Marker({
        id: elemId,
        map: map,
        position: results[0].geometry.location
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using google map API 3 and google geocoder. The problem is It's
I have a google map using V3 of the API. It has one marker
I have the following problem. I have embedded a map using Google Maps' API.
I am using Google Maps V3 API to display my map. Problem: How can
I am using Google Map API to do address translation(mainly by geocoder ). And
I'm using Google Maps Javascript API for showing a map in my site with
Google map api is not showing zoom bar and imagetype completely instead it is
I'm implementing geocoder using google map api v3 (javascript). I'm putting mutiple markers and
Hi I've been using Google Maps API v3 and geocoder to display a map
I have a site where i am using Google Map API v2 and google

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.