Skip to content

add marker property isAlwaysSelected on iOS#3134

Merged
rborn merged 3 commits intoreact-native-maps:masterfrom
brien-crean:feature-marker-isAlwaysSelected
Oct 23, 2019
Merged

add marker property isAlwaysSelected on iOS#3134
rborn merged 3 commits intoreact-native-maps:masterfrom
brien-crean:feature-marker-isAlwaysSelected

Conversation

@brien-crean
Copy link
Copy Markdown
Contributor

Does any other open PR do the same thing?

I couldn't find any PRs that add an always selected option on a marker (iOS).

What issue is this PR fixing?

It adds a property to the <Marker /> component called isAlwaysSelected which when set to true, allows a user to drag a marker immediately without having to first select it - similar to Android behaviour. This feature is useful when you want the ability to quickly drag markers rather than tap and then drag.

How did you test this PR?

Affects iOS only.
Tested on the latest version of react native - 0.61.2 on simulator and real device

@rborn
Copy link
Copy Markdown
Collaborator

rborn commented Oct 16, 2019

@brien-crean 😻 could you please amend the docs too ?

Few questions:

  • how does it behave on select ? does it work just like before? are there any drawbacks?
  • maybe find a better name 😅? isPreselected, instantDrag 🤣

@brien-crean
Copy link
Copy Markdown
Contributor Author

@rborn thanks for the feedback! I just updated the docs and the name to isPreselected 😄

onSelect fires as normal when a marker is tapped for the first time when this is enabled. The only drawback I see is that if you needed to programmatically check whether a marker was selected or not this would always return true.

I have been using this for a while on my fork and I really like it. I can immediately drag a marker without having to focus it first. It's particularly useful when a number of markers are the points of a polygon. I can easily drag markers to reshape the polygon.

@rborn rborn merged commit 7d200a3 into react-native-maps:master Oct 23, 2019
pinpong pushed a commit to pinpong/react-native-maps that referenced this pull request Feb 28, 2025
* add marker property isAlwaysSelected on iOS

* updated naming of feature to isPreselected to better reflect functionality

* updated Marker component docs for isPreselected prop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants