So I create a marker and make it draggable. It works good. I am trying to make this only true when in edit markers mode. My problem is when I am not in edit mode I cant turn it off. I have tried in setOnMarkerClickListener by doing marker.setDraggable(false) but that only works if the user clicks the marker first then tries to drag it, I have tried doing it in the onMarkerDragStart section but only works after the marker is dragged once but then since the marker is not draggable it never goes back to that section even in edit mode to turn it back on. I need a way to turn all markers draggability false when not in edit mode and true in edit mode. Any help would be so very much appreciated!
Set Google Maps API V2 markers draggable attribute to false after creating it?
466 Views Asked by BB Developer At
1
There are 1 best solutions below
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in GOOGLE-MAPS
- Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
- MarkerInfoWindow doesn't hold the clicked marker position after list refresh in Compose Map
- The Polyline is not showing in flutter but the directions api is enabled and the current position is not updating
- Unsure what imports to use for Advanced Marker Element
- The problem is that it takes a long time to index web pages in emdadrodbar.ir?
- distance matrix api gives incorrect data
- How to display google maps in dark mode in a .NET MAUI (Android) app
- Couldn't import Google Map API
- google maps api - how to get location information /place_id from shareable links maps.goo.gl
- 'map-advanced-marker' component not found after upgrading @angular/google-maps
- How to Filter bus stops between Start and Stop BUS STOP?
- How to make pressing on marker fill in the textViews
- Google api nearbysearch how to filter data business_status
- Embedded google map throws net::ERR_BLOCKED_BY_CLIENT in chromium(Brave) browser
- Why the code shows only the header and footer of xml file?
Related Questions in GOOGLE-MAPS-MARKERS
- MarkerInfoWindow doesn't hold the clicked marker position after list refresh in Compose Map
- 'map-advanced-marker' component not found after upgrading @angular/google-maps
- How to make pressing on marker fill in the textViews
- How to get loaded ref array on the first component load
- Flutter Google Maps - Custom Markers From Firestore string
- Android Maps Compose | MarkerState.setMarker IllegalStateException
- Add shadow to MarkerComposable of Google Maps in Compose
- MarkerComposable content (Google Maps) doesn't recompose in Compose
- MarkerClusterer class not found, cannot construct a marker cluster
- Manage actions on a marker with flutter_map 6.1.0
- How to get the exact coordinates of a marker with Matplotlib
- Live location and placing clickable markers on Openlayers
- Google Maps API does not render distance between two points
- Map Style to have no pins using Maps Platform Style Editor
- Google Maps Ground Overlay malfunctioning when zooming, moving or panning
Related Questions in GOOGLE-MAPS-API-2
- In Android Studio, how to use Google Maps route API as a gRPC?
- Google Maps/Mapbox API with ReactJS/Typescript web app using webpack not working?
- Need to get distance between two Google map locations
- Flutter Google map Navigation back is crashing with IOS
- Secret not working with @googlemaps/google-maps-services-js and firebase function
- How does google maps keep track of your location history?
- REACT: Google Maps API - Autocomplete affects input width
- Control marker visibility by zoom level Reactjs
- GoogleMaps API Macro/VBA Not Returning DriveTime & DriveDistance Anymore
- How to know whether I am at a straight road, a roundabout, or at a left or right turn, or a dead-end using Google Mapd SDK?
- How to add Google Maps to Flutter Web?
- JavaScript API: how do I add an Info Window to multiple markers on Google Maps?
- correct REST API for autosuggest on google?
- Is there a way to remove partial postcodes from GoogleMaps autocomplete dropdown?
- Reverse Geocode Locations in Google My Maps (Custom Map Locations to Street Addesses)
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I'm not sure what you mean by "edit mode". If I understood correctly, you have a markers that you want to make non-draggable. Make a new ArrayList and as you create a marker, add it to the list
For example:
Now, to make them all non-draggable, make a loop which iterates through the list of markers.
Edit
set the markers dragable in a loop