[Bug] Customed AdvancedMarker can't be dragged

Open
#746 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start by locating the AdvancedMarker component's handling of the draggable prop and compare it with the Google Maps API behavior described in the issue. Reproduce the custom Pin example and verify that dragging works through the gmpDraggable behavior.

Written by the indexing model from the issue text.

Description

bug
Description
                    <AdvancedMarker 
                        position={{lat: currentLocation?.lat, lng: currentLocation?.lng}}
                        draggable={true}
                    >
                        <Pin background="#0f9d58" />
                    </AdvancedMarker>

I found that this code does not allow the Pin element to be dragged. It should use gmpDraggable, but that property was omitted. I tested this using the raw Google Maps API, and confirmed that gmpDraggable works, whereas draggable does not.

Steps to Reproduce
                    <AdvancedMarker 
                        position={{lat: currentLocation?.lat, lng: currentLocation?.lng}}
                        draggable={true}
                    >
                        <Pin background="#0f9d58" />
                    </AdvancedMarker>
Environment
  • Library version:
  • Google maps version: weekly
  • Browser and Version:
  • OS:
Logs

Dominant language
TypeScript
Stars
2k
Forks
195
Avg merge
6h 26m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from visgl/react-google-maps

All issues in visgl/react-google-maps

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.