Hi,
I have a lot of (far too many, actually) hobbies. Drone flying and app writing being two of them. Some weeks ago I decided to combine these two and write a small app that shows my drone panorama pictures.
At first I used the newMapView. It worked all right, but it soon turned out to be too limited. So with the help of this post by Rob Miracle I switched to a WebView and an on-the-fly html code solution.
Now the app actually works more or less like I envisioned:
https://www.youtube.com/watch?v=qBKUtN_uGEw
The panoramas are created with PTGui and with an integrated tool made web ready. That is, they are converted to a special .html file along with some javascript code and a image set so that pointing to this .html file shows the panorama. I’ve slightly modified this .html file (made a .php file out of it to enable some parameters to be transferred) so that I only need one common .php for all panoramas.
Each panorama has (currently) these data:
-Name
-Comment
-Date
-Latitude/longitude
-GUID
(The GUID is used as a parameter to the .php file to point to the actual panorama files.)
I have a database on a server containing the panorama data above and at startup the app fetched this list. Based on the these coordinates I write a local .html file that uses the Google Map API and place markers at the correct positions. When a marker is tapped one of two things can happen (dependent on the settings). Either an info box opens, containing information about the panorama (along with a link to the panorama itself) or the panorama is shown directly. This is shown in the video above.
Now, as I said, most of the stuff works great. The only problem I have is related to what happens when I do a webview:back() and show the map with the markers again. If the user has zoomed the map to a preferred level and tap to show a panorama, this zoom level is reset when he goes back to the map again.
And I’m not sure how I can avoid this. Is there some way to communicate back to the Corona app when the user has zoomed the map? I know this event can be handled in the javascript code inside the generated .html file, but can it somehow be conveyed back to the parent app?