android - google map v3从sql加载标记

时间:2016-10-02 11:00:31

标签: android web-services google-maps-api-3 localhost

我创建了一个谷歌地图网页,其中lat和lon从本地主机mysql加载并保存为.txt,并将加载并标记到谷歌地图网页,它工作,所以可以将其转换为一个android webview?或者有一种更简单的方法。

1 个答案:

答案 0 :(得分:0)

关于在Android中使用webView,请尝试使用此SO thread

WebView webview = (WebView) findViewById(R.id.webView1);
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
//just replace the actual latlong values with your variables from SQL
webview.loadUrl("http://maps.google.com/maps?" + "saddr=43.0054446,-87.9678884" + "&daddr=42.9257104,-88.0508355");

还有一个来自Google文档的Using PHP/MySQL with Google Maps指南,您可以在其中将latlng值存储在SQL中,并在PHP的帮助下将标记加载到地图中。

video demo可能有助于实施。