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

Projects
None yet
4 participants
@ukrbublik
Copy link
Contributor

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.

ukrbublik added some commits Oct 6, 2018

fixes #2279
todo: add example
todo: AIRGoogleMapCalloutSubview*
todo: marker-inside-overlay-press?
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
fix
@christopherdro

This comment has been minimized.

Copy link
Collaborator

christopherdro commented Mar 12, 2019

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

@ukrbublik

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

christopherdro commented Mar 13, 2019

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

@rborn
Copy link
Collaborator

rborn left a comment

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 ?

Show resolved Hide resolved docs/callout.md Outdated
Show resolved Hide resolved docs/callout.md Outdated
Show resolved Hide resolved lib/ios/AirGoogleMaps/AIRGoogleMap.m Outdated
Show resolved Hide resolved lib/ios/AirMaps/AIRMapMarker.m Outdated
Show resolved Hide resolved package.json Outdated
@ukrbublik

This comment has been minimized.

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.

@rborn rborn merged commit 6ad2ffc into react-native-community:master Mar 15, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@WeslleyNasRocha

This comment has been minimized.

Copy link

WeslleyNasRocha commented Mar 16, 2019

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

@christopherdro

This comment has been minimized.

Copy link
Collaborator

christopherdro commented Apr 16, 2019

@christopherdro

This comment has been minimized.

Copy link
Collaborator

christopherdro commented Apr 16, 2019

@alvelig Any ideas?

@ukrbublik

This comment has been minimized.

Copy link
Contributor Author

ukrbublik commented Apr 16, 2019

@christopherdro
free(ivars) is missing

@christopherdro

This comment has been minimized.

Copy link
Collaborator

christopherdro commented Apr 16, 2019

@ukrbublik Thanks that did it.

@ukrbublik

This comment has been minimized.

Copy link
Contributor Author

ukrbublik commented Apr 16, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.