public final class MapContainer extends MapObject
Map
.
Applications can add certain types of MapObject
objects into a MapContainer
. For
more details, refer to addMapObject(MapObject)
.
You can use MapContainer.setVisible(boolean)
to control
whether the objects in the container are visible. If MapContainer.setVisible(true)
, then
the visibility settings of each map object in the container are used.
Unlike other map objects, MapContainer
does not support the use of visibility masks, so
you cannot set container visibility on a zoom level basis.
MapObject.Type
Constructor and Description |
---|
MapContainer()
Creates an empty
MapContainer . |
Modifier and Type | Method and Description |
---|---|
boolean |
addMapObject(MapObject object)
Adds a
MapObject to this MapContainer . |
boolean |
equals(java.lang.Object obj) |
java.util.List<MapObject> |
getAllMapObjects()
Returns the list of all
MapObject objects within this MapContainer . |
MapObject.Type |
getType()
Returns the type of object that this
MapObject represents. |
int |
getZIndex()
Returns the current z-index (stacking order) of this
MapContainer . |
int |
hashCode() |
boolean |
isVisible()
Determines whether this
MapContainer is visible on the map. |
boolean |
removeAllMapObjects()
Removes all
MapObject objects currently within this MapContainer . |
boolean |
removeMapObject(MapObject object)
Removes the specified
MapObject from this MapContainer . |
MapContainer |
setVisible(boolean isVisible)
Sets whether this
MapContainer is visible. |
MapContainer |
setZIndex(int index)
Sets a z-index (stacking order) value for this
MapContainer . |
getBaseType, getParent, getVisibleMask, resetVisibleMask, setVisible, setVisible, setVisibleMask, setVisibleMask, unsetVisibleMask, unsetVisibleMask
public boolean addMapObject(MapObject object)
MapObject
to this MapContainer
. Only the following types of
MapObject
objects can be added:
MapMarker
objectsMapCircle
objectsMapPolyline
objectsMapPolygon
objects
For a complete enumeration of available MapObject
types, refer to
MapObject.Type
.
object
- A MapObject
to add to this MapContainer
MapObject
was added successfully to this MapContainer
,
false otherwise (nesting MapContainer
is not supported).removeMapObject(MapObject)
public boolean removeMapObject(MapObject object)
MapObject
from this MapContainer
. If the specified
MapObject
is not contained within the MapContainer
, the container will be
unchanged.object
- A MapObject
to remove from this MapContainer
MapObject
was removed successfully from this MapContainer
, false otherwiseremoveAllMapObjects()
public boolean removeAllMapObjects()
MapObject
objects currently within this MapContainer
.MapObject
objects were removed successfully from this
MapContainer
, false otherwiseremoveMapObject(MapObject)
public java.util.List<MapObject> getAllMapObjects()
MapObject
objects within this MapContainer
.
Modifications to objects returned from the array are not guaranteed to be reflected properly
in the MapContainer
. Use addMapObject(MapObject)
and
removeMapObject(MapObject)
to modify individual array elements.
Note: the order of the MapObject
s returned in the List
is arbitrary. There is
no guarantee the list is sorted in the order the MapObject
s were added to the
MapContainer
.
MapObject
objects within the MapContainer
. If
the MapContainer
contains no map object, an empty array will be returned.public boolean isVisible()
MapContainer
is visible on the map.public int getZIndex()
MapContainer
. A higher z-index
indicates that the object is positioned more in front.public MapContainer setZIndex(int index)
MapContainer
.public MapContainer setVisible(boolean isVisible)
MapContainer
is visible.setVisible
in class MapObject
isVisible
- A boolean variable specifying whether this MapContainer
is visibleMapContainer
itself.MapObject.setVisible(int, boolean)
,
MapObject.setVisible(int, int, boolean)
public MapObject.Type getType()
MapObject
MapObject
represents.getType
in class MapObject
MapObject.Type
values