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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:29:39+00:00 2026-06-07T02:29:39+00:00

In my google maps application I have a follow method which follows a moving

  • 0

In my google maps application I have a follow method which follows a moving marker. When it is following I want to allow zooming through all the usual methods (dblclick, dblleftclick, mousewheel and touch events) and I want to disable panning of any kind. The problem is that on zoom with mousewheel and dblclick the map gets panned to the position of the mouse. I can disable everything just fine but I want to allow zooming. I have solved the mousewheel problem by using the jquery mousewheel plugin and using the delta to change the zoom.

Is there some easy way to do this or do I have to write a listener for all the different touch and mouse events?

EDIT

I have already disable double click, mousewheel zooming and dragging but I want to have the double click functionality still there. I also want the touch events there but I want to have them zoom from the centre rather than from where the event happened. The real problem is replicating the events which google already handle but change the functionality a bit

var options = {
    disableDoubleClickZoom: true,
    draggable: false,
    scrollwheel: false,
    panControl: false
};

this.map = new google.maps.Map(document.getElementById('map'), options);

My ideal solution would be if there was a disableDoubleClickPan and disableScrollwheelPan or the draggable option actual prevents all dragging of any kind

EDIT

This is for all devices, desktop and mobile.

  • 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-07T02:29:41+00:00Added an answer on June 7, 2026 at 2:29 am

    I have ended up going with a combination of options. Firstly I had to override desktop events which occurred to get my achieved result (touch, double click, double left click, and mouse wheel).

    On a touch screen devise I paused all updates to the markers when there were more than two touches. this meant that any pinch event was not jumping around when the zoom operating.

    On a normal web desktop device I disabled the zoom and double click events on the map and rewrote my own event handlers.

    To distinquish between them I checked for the ontouchstart event in the window object.

    function setDraggable(draggable) {
        if ("ontouchend" in document) {
            return;
        }
        var options = {
            draggable: draggable, 
            panControl: draggable, 
            scrollwheel: draggable 
        };
        this.map.setOptions(options);
    },
    

    The zoom_changed or idle events where not really an option for a few reasons:

    1. The idle event only gets called when the map is idle and with the amount of animation I was doing this never got called.
    2. The animation at each step recentered the map on the followed markers so the zoom_changed event would be recalling the recenter before an animation frame.
    3. due to the amount of animation the idea of not panning to the center is to reduce animation frames and improve performance.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application, i have following uses of google maps List
I have written a mapping application which can either use Google Maps or Open
I want to know if i can create a custom google maps application,on which
I have an application based on google maps, in which I am opening route
I have an application that uses the Google Maps API to geocode distances between
I have an application using the Google Maps javscript API and the Infobox plug-in
I have an application that currently links to Google Maps passing it the required
I am developing an ASP.NET web application that incorporates google maps. I have an
My web application is based on Google Maps API and I have problems trying
i have created an application in jquery and google maps javascript v3 , in

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.