Show geographic location using webview

I want to show a specific geographical location on Google maps. I can not use mapview / mapactivity.

Also I can not use the intention to view the action

Can I use webview for this?

+4
source share
2 answers

Open the url that should work:

webView.loadUrl("http://maps.google.com/maps?q=47.404376,8.601478"); 

Replace 47.404376,8.601478 with your lat / long. It works in a browser, I think on a mobile device it will open a mobile version of Google Maps.

+5
source

Check out the google static map API https://developers.google.com/maps/documentation/staticmaps/?hl=nl

You need to create a URL that displays a static map image (possible markers) of your location. You can download it and display it in image view mode.

 String latitude= "45.838211"; String longitude = "9.334661"; String url = "http://maps.google.com/maps/api/staticmap?center=" + latitude + "," + longitude+ "&zoom=10&size=400x400&sensor=false" 
+3
source

Source: https://habr.com/ru/post/1440519/


All Articles