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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:12:37+00:00 2026-05-18T20:12:37+00:00

I have and interface where a user can manage multiple locations for their business,

  • 0

I have and interface where a user can manage multiple locations for their business, adding additional locations and removing locations they no longer need.

In my interface I show a list of locations each with their own map.

My question is how do I lock a map to prevent the user from panning or moving the marker until they click on the “edit location” button?

Is there any sort of toggleMapLock function?

So far I have the following two methods. The lock(); method works fine, but the unlock(); method doesn’t work for some reason.

lock: function() {
  this.map.disableDoubleClickZoom = true;
  this.map.draggable = false;
  this.map.keyboardShortcuts = false;
  this.map.navigationControl = false;
  this.map.scaleControl = false;
  this.map.scrollwheel = false;
  this.map.streetViewControl = false;
  this.marker.draggable = false;
},

unlock: function() {
  this.map.disableDoubleClickZoom = false;
  this.map.draggable = true;
  this.map.keyboardShortcuts = true;
  this.map.navigationControl = true;
  this.map.scaleControl = true;
  this.map.scrollwheel = true;
  this.map.streetViewControl = true;
  this.marker.draggable = true;
  console.log("unlock");  
},
  • 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-18T20:12:38+00:00Added an answer on May 18, 2026 at 8:12 pm

    disableDoubleClickZoom (and the other properties listed) are not public properties on the Map class – they are properties of the MapOptions class. To change their value you need something similar to the following:

    lock: function() {
      this.map.setOptions({
        disableDoubleClickZoom: true,
        draggable: false
      });
    },
    
    unlock: function() {
      this.map.setOptions({
        disableDoubleClickZoom: false,
        draggable: true
      });
    }
    

    This creates a MapOptions object (inside the {}’s) and passes it to SetOptions, which updates the current state of the Map based on the values passed in.

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

Sidebar

Related Questions

I have and interface where a user can manage multiple locations for their business,
If use MongoRepository, You can have following code: @Repository public interface UserRepo extends MongoRepository<User,
A lot of JavaScript libraries have user interface widgets. Usually they are created after
I always have trouble designing the user interface when it come to manage a
I have a user interface where the user can check off a bunch of
I have made an interface whereby the user can create his own form. I've
I have an app that lets the user interact with several forms. I can
I have been developing an user interface with Java Swing, and I have met
I have to make a graphical user interface application using the language of my
I have an interface like this: public interface IUser{ //some properties here T ToDerived(User

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.