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

smellman
Copy link
Contributor

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
Copy link
Contributor

alvelig commented Feb 10, 2018

LGTM @rborn @christopherdro 🐽

@g3r4n
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
Copy link
Contributor Author

@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
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
Copy link
Contributor Author

@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
Copy link
Collaborator

rborn commented Feb 15, 2018

@smellman so no fix for this?

@smellman
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

@g3r4n
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
Copy link
Contributor Author

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

@g3r4n
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
Copy link
Contributor Author

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

@g3r4n
Copy link

g3r4n commented Feb 20, 2018

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

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.

LGTM @alvelig 🐽

@alvelig
Copy link
Contributor

alvelig commented Feb 20, 2018

LGTM

@aravi365
Copy link

still facing the issue on latest version

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.

5 participants