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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:09:12+00:00 2026-05-26T21:09:12+00:00

Well I’m having a couple problems getting google maps to work using the v3

  • 0

Well I’m having a couple problems getting google maps to work using the v3 API.

Look here: [Removed by Poster]

Both maps are, in fact, working but the zoom level seems like it is random. The zoom is set to 12 when the map is initialized. Also, if you click on the marker, the description box is missing corners and is unable to be closed. Here is the javascript functions I am using to activate these maps:

var mapHash = [];
var bound = new google.maps.LatLngBounds();
finishedCoding = false;
function initMap(map_container_div,lat,lng) {
    var latlng = new google.maps.LatLng(lat,lng);
    var myOptions = {
        zoom:12,
        center:latlng,
        mapTypeId:google.maps.MapTypeId.ROADMAP,
        streetViewControl: false
    };

    var map = new google.maps.Map(document.getElementById(map_container_div), myOptions);
    if (!getMap(map_container_div)) {
        var mapInfo = {
            mapkey:'',
            map:'',
            geocoder : new google.maps.Geocoder()
        };
        mapInfo.map = map;
        mapInfo.geocoder = new google.maps.Geocoder();
        mapInfo.mapKey = map_container_div;
        mapHash.push(mapInfo);
    }
}

function placeMarker(myAddress, mapId, description, title) {
    mapIndex = getMap(mapId)
    //alert(myAddress + mapId + map)
    mapHash[mapIndex].geocoder.geocode({
        'address':myAddress
    }, function (results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            mapIndex = getMap(mapId)
            var marker = new google.maps.Marker({
                map:mapHash[mapIndex].map,
                position:results[0].geometry.location,
                title: title
            });
            bound.extend(results[0].geometry.location);
            mapHash[mapIndex].map.fitBounds(bound);

            finishedCoding = true;
            placeDesc(marker,description,mapId);

        }
    });
}

function placeDesc(marker,myDesc,mapId) {
    mapIndex = getMap(mapId);
    var infowindow = new google.maps.InfoWindow({
        content: myDesc
    });
    google.maps.event.addListener(marker, 'click', function() {
      infowindow.open(mapHash[mapIndex],marker);
    });
}

function getMap(mapKey) {
    for (var i = 0 ; i < mapHash.length ; i++) {
        if (mapHash[i].mapKey == mapKey) {
            return i;
        }
    }
    return false;
}

function startmap(mapidd,address,description,title,lat,lng) {
    initMap(mapidd,lat,lng)
    placeMarker(address,mapidd,description,title)
}
  • 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-05-26T21:09:13+00:00Added an answer on May 26, 2026 at 9:09 pm

    I solved this issue myself and am kicking myself for not thinking of this. 🙂

    Just had to add mapHash[mapIndex].map.setZoom(12);

    And I removed the following 2 codes:

    bound.extend(results[0].geometry.location);
    mapHash[mapIndex].map.fitBounds(bound);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well behaved windows programs need to allow users to save their work when they
Well, this is my first post here and really enjoying the site. I have
Well, here we are. Yet another proposed practice that my C++ book has an
Well, the subject says everything. I'm using json_encode to convert some UTF8 data to
well I think I know what the problem is. I am just having a
Well it's not realy causing any errors. Anyways i'm sending ajax request and getting
Well normally I am quite good at figuring and researching problems without guidance however
Well, I just started to work on server side scripting , I chose PHP,
Well, this must be a silly one. Here below is a can-not-be-simpler code in
Well I have a view of this type of hierarchy Main View (having some

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.