在Android上使用WebView查看地图并设置标记(图钉)

发布于 2024-09-28 17:56:52 字数 314 浏览 1 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

放手` 2024-10-05 17:56:52
http://maps.google.com/maps?saddr=37.423156,-122.084917

上面只是显示了缺少目的地字段的路线屏幕。如果您希望图钉显示在简单的地图屏幕上,请执行以下操作:

http://www.google.com/maps?q=37.423156,-122.084917
http://maps.google.com/maps?saddr=37.423156,-122.084917

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:

http://www.google.com/maps?q=37.423156,-122.084917
や三分注定 2024-10-05 17:56:52

显然有很多剥猫皮的方法 - 但我喜欢 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

心作怪 2024-10-05 17:56:52
http://maps.google.com/maps?saddr=NJ 

加载像这样的 URL,传递您想要放置 PIN 的地址

http://maps.google.com/maps?saddr=NJ 

load URL like this pass address where you want to put the pin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文