直接在 WebView 或 MapView 中使用 Google Maps JavaScript API?优点和缺点?

发布于 2024-11-05 19:08:00 字数 543 浏览 2 评论 0原文

看来在 Android 上的 Mapview 中开发地图应用程序更为传统。
但我觉得另一种方式听起来也很不可抗拒。

由于我以前开发过Web,所以我对通过JavaScript控制Google Map API感到更加熟悉。得益于 Android 的强大功能,JavaScript 与 Action 交互,看来唯一犹豫的理由是性能?我还没有测试过。

当考虑跨平台时,JavaScript 再次具有优势,我可以轻松修改我的应用程序以适应其他平台,甚至还有像 PhoneGap 帮助我做到这一点。

有没有人以前做过这个可以告诉我我应该注意什么?
我不知道JavaScript API密钥是否可以在本地网页上使用?

非常欢迎讨论两种方式的优缺点并分享您的意见!

It seems that developing a map app in a Mapview on android is more traditional.
But I feel the other way also sounds very irresistible.

Since I was developing webs before, I feel more familiar to control Google Map API by JavaScript. And thanks to the strong feature of Android about JavaScript interacting with Action, It seems the only reason to hesitate is the performance? Which I have not tested yet.

When considering cross-platform, JavaScript has the advantage again, I can modify my app to fit other platform easily, there are even open-source projects like the PhoneGap to help me do this.

Is any one has done this before can tell me about what I should be care for?
And I don't know if the JavaScript API key works on local webpages?

Very welcome to discus Advantages and disadvantages of the two ways and share your opinions!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

删除会话 2024-11-12 19:08:00

我已经尝试过 webview 中的谷歌地图和作为本机组件的谷歌地图。首先,网络开发既简单又有趣。它适用于 iPhone 和 Android。但与 iPhone webview 相比,android webview 的性能很糟糕。在iphone中使用webview是合理的,但在android中则不行。

只需查看谷歌地图本机应用程序并从本机浏览器打开谷歌地图即可。它缺乏性能。与本机版本相比,打开时间较慢。您应该仅使用按钮来缩小和放大。因为放大和缩小的手势不起作用。这是我认为当用户使用本机应用程序并想要使用手势时的主要问题。我对 webview 组件不满意,最后我切换到了原生版本。

总而言之,如果您没有太多时间并且希望您的应用程序同时适用于 android 和 iphone,那么请使用 webview。但如果性能很重要并且您有时间开发,那么请使用本机版本。只需在手机上尝试一下即可。

I have tried both google maps in webview and as a native component. First of all developing for web is easy and fun. It will work in both iphone and android. But android webview performance sucks when you compare to iphone webview. It can be reasonable to use webview in iphone but not in android.

Just look at google maps native app and open google maps from native browser. It lack of performance. Opening time is slow when compared to native version. And you should zoom out and in just by using buttons. As gestures to zoom in and out does not work. This is the main problem I think as users use native app and wants to use gestures. I did not satisfied from webview component at last I switched to native version.

To sum up, If you do not have too much time and want that your app works for both android and iphone, then use webview. But if performance is important and you have time to develop, then use native version. Just go and try both on your phone.

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