叠加,overlayitem和itemizedoverley之间的混淆 [英] confusion between overlay, overlayitem and itemizedoverley

查看:214
本文介绍了叠加,overlayitem和itemizedoverley之间的混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个显示的地图,并在此地图之上,利益的道路和点将被画成线条和椭圆形的应用程序。这些线和椭圆将附加有这样用户可以拖动它们或删除监听器。

I wanting to create an app which displays a map and on top of this map, the roads and points of interests will be painted as lines and ovals. These lines and ovals will have listeners attached to them so the user can drag them around or delete them.

我使用与osmdroid开放街道地图但它似乎是完全一样的谷歌地图。

I am using openstreetmaps with osmdroid however it seems to be exactly the same as Google Maps.

我想扩展OverlayItem类重新present兴趣或道路的一个点。该覆盖类将进行扩展和包含这些扩展OverlayItems的ArrayList

I was thinking of extending the OverlayItem class to represent a point of interest or a road. The Overlay class would be extended and contain an ArrayList of these extended OverlayItems.

叠加类的Draw方法将被覆盖,将油漆全部包含在ArrayList中的OverlayItem的。

The draw method of the Overlay class would be overridden and would paint all of the OverlayItem contained in the arraylist.

这覆盖类,然后添加到的MapView。

This Overlay class is then added to the MapView.

我不知道这是否会起作用,因为很多教程使用ItemizedOverlay。到底这是什么,我应该使用它吗?

I am not sure if this would work because a lot of tutorials use an ItemizedOverlay. What exactly is this and should I be using it?

感谢

推荐答案

这是 ItemizedOverlay 是扩展一个类覆盖 (因为你想要做的),并基本完成(你仍然需要扩展它,并填补了特定部分),以可绘制的列表中指定添加到地图 Geopoints (使用 OverlayItem 的列表)。它还实现了中的onTap()为项目添加的。

An ItemizedOverlay is a class extending Overlay (as you want to do) and mostly completed (you still need to extend it and fill the specific parts) in order to add a list of Drawables to the map in specified Geopoints (using a list of OverlayItem). It also implements onTap() for the items added.

所以底线, ItemizedOverlay 为pre-codeD级的目标似乎是你的目标。

So bottom line, ItemizedOverlay is a pre-coded class aiming what seems to be your objective.

限制

这可能不适合所有叠加的最佳解决方案...

It may not be the best solution for all your overlays ...

例如它会更好地使用自己的CALSS延伸覆盖:

Examples where it would be better to use your own calss extending overlay:


  • 如果你的 POI 要求可绘制,需要在被转动
    运行时(即在变化方向的箭头指向)

  • 如果你想画没有标志的路线

  • 如果你想画的东西,不能从一个绘制
  • 被制成伊斯利
  • If your POI requires a Drawable that needs to be rotated at runtime (i.e. an arrow pointing in a changing direction)
  • If you want to draw a route without markers
  • If you want to draw something that can't be easly made from a drawable

问候。

这篇关于叠加,overlayitem和itemizedoverley之间的混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆