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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:25:14+00:00 2026-06-05T06:25:14+00:00

I wonder whether someone may be able to help me please. I’m using this

  • 0

I wonder whether someone may be able to help me please.

I’m using this page to allow users to view markers saved in a MySQL database and to geocode/reverse geocode new marker positions.

I’m able to correctly center the map on the marker which is being loaded from the database, but the problem I’m having is that the map zooms in to it’s maximum setting, whereas I would like to be able to set this manually.

I’ve tried adding another zoom control into my script here:

// add marker
var bounds = new google.maps.LatLngBounds(); 
var loc = new google.maps.LatLng(las[i],lgs[i]);
var marker = new google.maps.Marker({
position: loc, 
map: window.map,
zoom: 8,
title: nms[i]
});
bounds.extend(loc);
map.fitBounds(bounds);

Unfortunately this has no affect. I appreciate that to some this may be a very minor fix, but I’ve been looking at this for sometime and I just can’t seem to find a solution.

I just wondered whether someone may be able to look at this please and let me know where I’ve gone wrong?

POST UPDATE

I have worked out a solution using exisitng code and that suggested by @Andrew Leach. The working solution is:

// add marker
var bounds = new google.maps.LatLngBounds(); 

var loc = new google.maps.LatLng(las[i],lgs[i]);
var marker = new google.maps.Marker({
position: loc, 
map: window.map,            
title: nms[i]
});
bounds.extend(loc);
map.fitBounds(bounds);
map.setZoom(16);
  • 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-05T06:25:17+00:00Added an answer on June 5, 2026 at 6:25 am

    Remove the references to the bounds.

    You add a marker to the map, and create a LatLngBounds object which contains only that single point. You then ask the map to zoom in to fit the bounds into the map’s viewport. Fitting a single location into the viewport will always zoom in as far as it can, and even then a single point can never fill the entire viewport.

    However, adding zoom to the marker options won’t work either, because zoom is not a valid option. Documentation

    Instead, set the map’s zoom explicitly, either with map.setZoom(8) or by including the zoom option in the map’s options when you set it up.

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

Sidebar

Related Questions

I wonder whether someone may be able to help me please. I'm using this
I wonder whether someone may be able to help me please. I'm using this
I wonder whether someone may be able to help me please. I'm using the
I wonder whether someone may be able to help me please. I'm using Aurigma
I wonder whether someone may be able to help me please. Using some excellent
I wonder whether someone may be able to help me please. I'm using the
I wonder whether someone may be able to help me please. I am using
I wonder whether someone may be able to help me please. I'm using the
I wonder whether someone may be able to help me please. I'm using the
I wonder whether someone may be able to help please. I'm using the script

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.