简体   繁体   中英

Google Maps in a Webview for Android

I have a pair of questions about google maps for android. I decided to use a webview to display google maps due to the compatibility for the google maps api, so i'm having problems with really simple things (at least i think the are simple).

1) At the start of the application, my webview shows the map with a very low zoom. How can i set a higher zoom from the beginning? There are +/- buttons, but they are pretty uncomfortable.

2) How can i put a mark on the map? With the api, i have just to use the

google.maps.Marker

, but i don't know ho to use it with a webview. I think that both the problems can be solved using javascript, but i'm new and i really don't know how to solve them. Thank you very much.

For the marker, you could create a javascript function to add a marker, and then on the WebView load a url like javascript:addAMarker("AddItHere"); . I don't get what you mean the buttons are uncomfortable for the +/-.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM