Reputation: 2093
So it's a simple app showing a webview with a mymap, and, oh my, Google have made it wonderful. They've extracted all the markers and info boxes and sent them off to the Google maps app where they're displayed as cards.
But this creates problems.
I presume if Googlemaps is not installed the app will show the slightly clunky webview myMap. For those who have been redirected to Google maps,when they relaunch my app (without having closed it), or navigate back to it, I'd like a button to let them switch to where the map is, in the googlemaps app.
Any idea how to do this? Do you think it's reasonable to assume 90% of people have Googlemaps installed?
Is there a better way of handling things?
Forgive me if I ask too much.
Upvotes: 1
Views: 903
Reputation: 1572
Maybe you can try to load an iframe to you webview with your location. For example
String html ="<iframe src=\"https://www.google.com/maps/embed?....></iframe>";
WebView webview;
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadData(html, "text/html", null);
This will allow you to load this iframe inside your application.
Upvotes: 1