question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need marker to be fixed, only map should be movable

See original GitHub issue

I do not want marker to be draggable, it should be fixed to the center of div, I want only the map to be draggable.

So that user can just drag the map and set the location by its fixed marker.

Note: Now the user has to search the marker, if lost while playing around the map. A fixed marker will help a lot.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Sumragencommented, Sep 7, 2016

Now it’s too simple, just set property ‘markerDraggable’ to false. For example:

$('#map-example').locationpicker({
   draggable: true,
   markerDraggable: false //default - true
});
1reaction
amythcommented, Oct 14, 2016

I think it still does not work. The marker appears in the center once the I have dragged and dropped the map. Shouldn’t the marker stay in center even while I am moving the map ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keep marker in center and move map around it | by Ali Zahid
The most common solution to this problem is, you put a marker in the middle of the map, and the user moves the...
Read more >
Keeping a marker centered even during map move
While most of it works, but I just can't figure out how to keep the marker cenrtered during the map drag/pan. Here's what...
Read more >
How can I prevent Leaflet from moving my marker while ...
Given your marker, you need the icon to be Anchored to the bottom center of the icon, for which, the following code should...
Read more >
Retain Location address when moving the map marker
If I want the address to change, then I will fix the address, ... the original address there if we only need to...
Read more >
Marker Clustering | Maps JavaScript API - Google Developers
To see how marker clustering works, view the map below. ... markers can only be keyboard focusable when they have click listeners
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found