gpt4 book ai didi

Android map API v2 : where are the Overlays?

转载 作者:搜寻专家 更新时间:2023-11-01 08:05:44 27 4
gpt4 key购买 nike

我已经编写了一个在 Android 中使用 GoogleMaps Api v1 的应用程序。这个应用程序使用多个 Overlays(或 ItemizedOverlays)来自动处理一堆事情(即延迟加载标记,因为我有很多标记并将它们全部添加到一旦将强制应用程序关闭)。我还将它们用作用户的界面:他可以决定他想看到哪些叠加层(或者从他的角度来看是哪种标记)。我相应地添加或删除了这些Overlays。现在我想切换到新的 maps-v2-api。该文档没有提及Overlays,并且似乎无法扩展Markers,因为它们是final

我是否被迫模仿以前的 map 行为,以便能够添加和删除自己处理标记Overlays?有谁知道谷歌删除这个有用的工具并迫使任何开发人员完全重写谷歌地图相关代码的原因吗?我还想知道制作 Markerfinal 的原因,从而防止任何人添加与之相关的内容? (我看到的解决方案存储一个全局 HashMap,其中标记作为键,它们需要的信息作为值,在我看来,考虑到标记可能具有与其相关的不同模型,这是非常丑陋的)。

最佳答案

Am I forced to kind of emulate the previous maps behavior, to be able to add and remove Overlays which handle Markers themself?

是的。

Does anyone know a reason why Google removed this useful facility, and forces any dev to completely rewrite the GoogleMaps related code?

Google 工程师可能知道原因。

据我所知,对于简单的场景,新方法需要的代码更少。 Maps V1 需要叠加层,而叠加层对于许多应用程序来说是过大的杀伤力。

I like to know also a reason for making the Marker class final, thus preventing anyone to add something related to it?

因为 Marker 用于 IPC,并没有真正保留在您的流程中。基于 Cyril Mottier's research,您使用 Maps V2 所做的几乎所有操作都会导致 IPC 调用.

关于Android map API v2 : where are the Overlays?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14526482/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com