在Android上使用WebView查看地图并设置标记(图钉)
我正在 android 上制作一个应用程序,使用 webview 加载谷歌地图(使用此网址作为我的 webview: http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html)。 但我无法在该网络视图上放置标记,有人可以告诉我如何做吗?
I'm making an app on android, using webview to load google map (using this url for my webview: http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html).
but i can't put a marker on that webview, can't somebody tell me how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
上面只是显示了缺少目的地字段的路线屏幕。如果您希望图钉显示在简单的地图屏幕上,请执行以下操作:
The above simply shows the directions screen with missing destination field. If you want the pin to show on a simple map screen do this instead:
显然有很多剥猫皮的方法 - 但我喜欢 Google 静态地图 API。
它会生成标准图像(所需大小),您可以从 URL 添加点/线/多边形。
虽然我没有检查条款,但显然可以缓存/存储结果。
文档:http://code.google.com/apis/maps/documentation/staticmaps/
示例:http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14& ;尺寸=512x512&maptype=路线图&标记=颜色:蓝色%7Clabel:S%7C40.702147,-74.015794&标记=颜色:绿色%7Clabel:G%7C40.711614,-74.012318&标记=颜色:红色%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false
Clearly lots of ways to skin a cat - but I am loving the Google Static Maps API.
It generates a standard image (of desired size) and you can add points/lines/polygons all from a URL.
Whilst I haven't checked the terms, it is clearly possible to cache/store the result.
Documentation: http://code.google.com/apis/maps/documentation/staticmaps/
Example: http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false
加载像这样的 URL,传递您想要放置 PIN 的地址
load URL like this pass address where you want to put the pin