Issue
I have a custom styled Google Maps embeded on my site (see example here http://bit.ly/10sPaTb)
Now, is there anyway to make the maps look like this inside an Android app? I have tried using a webview to embed the map but i only get a blank page.
If I would use the Android mapview, is it possible to make it look like the custom style or can I only use Google's standard map look?
Solution
I managed to get it to work. There is two solutions, either I can use Phonegap for the activity (which works perfectly), using a webview also works. The problem was that the javascript was NOT enabled. What I did was that I downloaded the scripts and HTML file from the link in the question, then put the files in /assets/www/ and pointed the webview to the local .html file.
WebView myWebView = (WebView) findViewById(R.id.webView1);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("file:///android_asset/www/index.html");
I tried to use the following code to access the GPS database for positioning
myWebView.getSettings().setGeolocationDatabasePath("/data/data/<app-name>");
But that didn't work, when I used Phonegap the positioning worked perfectly. Hope someone out there could take advantage of this sometime.
Answered By - timbillstrom
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.