开发者

I want to show google map by passing latitude and longitude as destination and also my current location too

开发者 https://www.devze.com 2023-03-31 16:09 出处:网络
I want to show google map at by latitude and longitude. Yet i am using Address to show Gmap. Here is my code:

I want to show google map at by latitude and longitude.

Yet i am using Address to show Gmap.

Here is my code:

Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(Uri.parse("geo:0,0?q=" + ("2100 California St., Eureka, CA")));
                try {
                    startActivity(intent);
                } catch (Exce开发者_JAVA技巧ption e) {
                    e.printStackTrace();
                }

i want to show map by latitude & longitude.

thanks in advance.


just put the latitude and longitude in the query like this:

            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("geo:0,0?q=" + ("40.7890011, -124.1719112")));
            try {
                startActivity(intent);
            } catch (Exception e) {
                e.printStackTrace();
            }
0

精彩评论

暂无评论...
验证码 换一张
取 消