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

Support Map.Overlay for iOS #2022

Merged
merged 7 commits into from Feb 20, 2018

Conversation

Projects
None yet
4 participants
@smellman
Copy link
Contributor

smellman commented Feb 10, 2018

Map.Overlay supports only Android so I did re-implement #1359 for iOS.
But I didn't write any code for Google Maps iOS because my simulator didn't run "Use GoogleMaps?" switch.

@alvelig

This comment has been minimized.

Copy link
Collaborator

alvelig commented Feb 10, 2018

LGTM @rborn @christopherdro 🐽

@g3r4n

This comment has been minimized.

Copy link

g3r4n commented Feb 11, 2018

Thank you very much for the work !
I've test it with the default ImageOverlayWithURL example file and got the following output when zoming in :
simulator screen shot - iphone 6 - 2018-02-11 at 15 05 48
Is it expected ?

@smellman

This comment has been minimized.

Copy link
Contributor Author

smellman commented Feb 12, 2018

@g3r4n

Is it expected ?

Maybe yes.
It seems MKOverlay actions.
When zoom up, image's coordinate will overlap so odd image will break.

I added offset in coordinates in example:

// 116423, 51614, 17
const OVERLAY_TOP_LEFT_COORDINATE2 = [35.679609609368576 + 0.000001, 139.76531982421875 + 0.000001];
const OVERLAY_BOTTOM_RIGHT_COORDINATE2 = [35.67737855391474 + 0.000001, 139.76806640625 + 0.000001];
const IMAGE_URL2 = 'https://maps.gsi.go.jp/xyz/std/17/116423/51614.png';

Results are following:

2018-02-13 6 16 10

2018-02-13 6 16 17

The image is break again but the breaking zoom level will increase by offset (0.000001).

@rborn

This comment has been minimized.

Copy link
Collaborator

rborn commented Feb 13, 2018

@g3r4n @smellman could it be something related to the way the overlay images are created? Don't they need to respect some strict rules?

@smellman

This comment has been minimized.

Copy link
Contributor Author

smellman commented Feb 13, 2018

@rborn Yes, it is related. But in this case, making tile images using GeoServer or other programs is better. Also, react-native-maps supports tile images (UrlTile or LocalTile).

@rborn

This comment has been minimized.

Copy link
Collaborator

rborn commented Feb 15, 2018

@smellman so no fix for this?

@smellman

This comment has been minimized.

Copy link
Contributor Author

smellman commented Feb 17, 2018

@rborn I change my example a bit.
Also, v0.20.1 enable to use GoogleMaps again, so I re-implement GoogleMaps API for iOS.

@smellman

This comment has been minimized.

Copy link
Contributor Author

smellman commented Feb 17, 2018

I finished implement additional support for GoogleMaps and edit my example.
Please check it again.

@g3r4n

This comment has been minimized.

Copy link

g3r4n commented Feb 17, 2018

@smellman ok i understand the issue now 😄 I agree with you people should use UrlTile or LocalTile when image's coordinate will overlap.
Can you update the documentation to let people know about this limitation ?
Thank you for your hard work, i hope this PR will be merged soon !

@smellman

This comment has been minimized.

Copy link
Contributor Author

smellman commented Feb 17, 2018

@g3r4n I pushed the documentation.
But I'm not native in English, if something wrong, please point out.

@g3r4n

This comment has been minimized.

Copy link

g3r4n commented Feb 18, 2018

@smellman Hmm i manage to reproduce the issue, but only on iOS device not in the simulator.
Before zooming :
img_0023
After zooming :
img_0024
Can you investigate ? Will try to investigate from my own

@smellman

This comment has been minimized.

Copy link
Contributor Author

smellman commented Feb 18, 2018

@g3r4n I fix the bug, I forget to fix parameter order in MKMapRectMake.
It's completely my mistake.

@g3r4n

This comment has been minimized.

Copy link

g3r4n commented Feb 20, 2018

Works like a charm ! test are OK on iOS from my end.
cc @alvelig @rborn @christopherdro

@rborn
Copy link
Collaborator

rborn left a comment

LGTM @alvelig 🐽

@alvelig

This comment has been minimized.

Copy link
Collaborator

alvelig commented Feb 20, 2018

LGTM

@alvelig alvelig referenced this pull request Feb 20, 2018

Closed

Use a local image as map #2033

@rborn rborn merged commit 42ff69a into react-native-community:master Feb 20, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
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.