Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom callout improvements #2581

Merged
merged 15 commits into from
Mar 15, 2019

Conversation

ukrbublik
Copy link
Contributor

@ukrbublik ukrbublik commented Nov 11, 2018

Added new feature - handling press on callout subview for iOS.
This required adding new component <CalloutSubview /> with onPress event.
See "Custom Callouts" (Callouts.js) example.

Added prop alphaHitTest for Callout.
If true, press on transparent areas in custom callout will be passed to map (will hide current callout or open callout of another marker positioned at touch point).
It's very useful for custom callouts with big transparent areas. At example bottom part of custom callout is transparent (except arrow).

Added prop zoomTapEnabled for MapView.
If false user won't be able to double tap to zoom the map. BUT it will greatly decrease delay of single tap gesture recognition in Google Maps for iOS so callouts will open much faster!

Added method redrawCallout for Marker. Useful for Google Maps on iOS.

Also added method getMarkersFrames(onlyVisible=false) for MapView.
It gathers all (or only visible) markers and return their frames and centers in pixels.
See "FitToCoordinates" example.
It's not related to callouts but uses same new methods I added in this PR and can be useful on JS-side.

Does any other open PR do the same thing?

It's improved version of my past PR #2538

What issue is this PR fixing?

#2279

How did you test this PR?

Change affects iOS, both Google & Apple map providers.
Tested in iOS simulator and real devices.

@christopherdro
Copy link
Collaborator

@ukrbublik Should this replace #2538 or do both go together?

@ukrbublik
Copy link
Contributor Author

ukrbublik commented Mar 13, 2019

@christopherdro

@ukrbublik Should this replace #2538 or do both go together?

Yes, it fully replaces #2538

@christopherdro
Copy link
Collaborator

@ukrbublik Thanks for the update. Any chance you can resolve the merge conflicts in this PR for proper review?

Copy link
Collaborator

@rborn rborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments only,

One question though - what it would take to have the "ios only" features on android too? Is a limitation of the SDK ?

@ukrbublik
Copy link
Contributor Author

ukrbublik commented Mar 14, 2019

@rborn Thanks for review. Updated PR.
As for Android, sadly I don't have skills in Android development.

Fixes after rborn's review
@rborn rborn merged commit 6ad2ffc into react-native-maps:master Mar 15, 2019
@WeslleyNasRocha
Copy link

i cant make any promises, but i will try to implement the getMarkersFrames() on android, cus im in need of it

@christopherdro
Copy link
Collaborator

@christopherdro
Copy link
Collaborator

@alvelig Any ideas?

@ukrbublik
Copy link
Contributor Author

@christopherdro
free(ivars) is missing

@christopherdro
Copy link
Collaborator

@ukrbublik Thanks that did it.

@ukrbublik
Copy link
Contributor Author

Seems like from #2782 leek is still present, I will take a look today

pinpong pushed a commit to pinpong/react-native-maps that referenced this pull request Feb 28, 2025
* fixes react-native-maps#2279

todo: add example
todo: AIRGoogleMapCalloutSubview*
todo: marker-inside-overlay-press?

* upd

* additions to readme

* removed unused (for now) delegate patching

* lint fixes

* Pass `point` at callout press events

* Also pass callout frame
todo: fix for Apple map

* - Added prop `alphaHitTest` for `Callout`
- Added method `getMarkersFrames(onlyVisible=false)` for `MapView`
- Fix for pinch gesture

* lint fixes

* added `getMarkersFrames` to docs

* fix

* Added `zoomTapEnabled` for `MapView`

* Added redrawCallout

* Fixes after rborn's review
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.

4 participants