Replies: 1 comment 2 replies
-
Awesome, looks really good. I don't understand the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scrolling Support
I've been experimenting on iOS in order to find a way to support scrolling with maps.
So far this is my research/experiment.
I'm using my latest changes on iOS
In WKWebKit you can set it to use the native UIScrollView instead of the web scroll, that way the maps will scroll with the web view. This is completely true if you are using pure Capacitor without any Framework/UI-Templates that use shadow DOM.
I lost this code, but I anyone need it I can recreate it for references, but there a lot of tutorial for doing this.
As soon you start using a modern framework, this doesn't work. In the frameworks the shadow DOM take control of everything, in these case the scrolling. In general isn't recognized by any browser and the browser believe the scrolling is in the root of page .
Every user/developer use a different frameworks to done there product, in the other experiment, I made a method for the developer to implement in order to send the scrolling data from view/page of the map to the plugin to sync the scrolling.... This works, However the way capacitor handle this data the result is terrible in performance.
I keep the same approach, but I did differently. The browser have script message for two ways communication between the host and the application, Capacitor already is using it to handle the execution of methods of plugins. Because I did a custom web view on iOS, I added the necessary configuration to handle the scrolling data directly and now is working almost perfectly.
This is my result (iOS Simulator):
Demo.Preview.Capacitor.Google.Maps.mp4
Note:
Code:
https://github.com/va2ron1/capacitor-googlemaps-native/commits/scrolling-experiment
Example with Ionic Framework:
HTML
Code method
Example with only Capacitor:
Just need to add an event listener on scroll and on the changes add the following code:
Android
I've done the same approach but I can't find the right values to translate the values from DOM to the native view. This code isn't in the branch.
Beta Was this translation helpful? Give feedback.
All reactions