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

  • Home
  • SEARCH
  • 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,
I have a user interface in .net which needs to receive data from a
Applications which run on mobile devices have special user interface requirements. I think Apple
I have a custom WinForms control (inherits from control, i.e. without user interface jsut
Lets say you have interface definition. That interface can be Operation . Then you
I have an Interface called IStep that can do some computation (See Execution in
I have a function that presents the user a combo-box. def select_interface(interfaces) list_box :items
If I have interface IFoo, and have several classes that implement it, what is
Suppose we have: interface Foo { bool Func(int x); } class Bar: Foo {
Have a interface class abc { public: virtual int foo() = 0; ... }

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.