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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:18:39+00:00 2026-05-27T13:18:39+00:00

Hey guys I’ve finally got my google maps working the way I want it,

  • 0

Hey guys I’ve finally got my google maps working the way I want it, but I don’t want my zoom to prevent the user from zooming in themselves (this keeps resetting it), I put a conditional on my setZoom to only get it to fire on first watchposition() but if I do that then the the maps sits at maximum zoom for some reason.

function CreateMap() {
            var zoomWithoutLatLng = 13;
            var zoomWithLatLng = 15;
            Data.$paymentMap.gmap({'center': GetLatLng(), 'zoom' : zoomWithoutLatLng}).bind('init', function(evt, map) {
                Data.$paymentMap.gmap('watchPosition', function(position, status) {
                    if (status === 'OK') {
                        Data.$paymentMap.gmap({'zoom' : zoomWithLatLng});


                        var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
                        var userMarker = Data.$paymentMap.gmap('get', 'markers > user' );
                        if (!userMarker) {
                            Data.$paymentMap.gmap('addMarker', { 'id': 'user', 'position': GetLatLng(), 'bounds': true) });
                        } else {
                            userMarker.setPosition(latlng);
                            map.panTo(latlng);
                        }
                    } 
                });
            });
        }        
        function GetLatLng() {
            if (google.loader.ClientLocation != null) {
                return new google.maps.LatLng(google.loader.ClientLocation.latitude, google.loader.ClientLocation.longitude);
            }
        }
  • 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-27T13:18:40+00:00Added an answer on May 27, 2026 at 1:18 pm

    The property ‘bounds’ on addMarker will override the zoom setting so change it to ‘bounds’:false

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

Sidebar

Related Questions

Hey guys, I want to parse some xml but I don't know how I
Hey guys got an issue with Cakephp validation.. I want to know why is
Hey guys I'm currenlty working on something and I want if I click a
Hey guys I'm working with this forum, I want to hide the categories list,
hey guys, I have mypage.com/user-login.php?action=register and I want to be able to call mypage.com/register
hey guys having this really simple problem but cant seem to figure out have
Hey guys I wanted to create a JScrollPane but it won't work... and I
Hey guys was hoping you could help me out. basically i'm working on a
Hey guys, I want to make a function loop over all elements that have
Hey guys, I'm trying to select a specific string out of a text, but

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.