HERE Android SDK Developer's Guide

VenueMapFragment

The class VenueMapFragment is a member of com.here.android.mpa.venues3d .

Class Summary

public class VenueMapFragment

   implements com.here.android.mpa.venues3d.VenueLayerAdapter

extends com.here.android.mpa.mapping.MapFragment, java.lang.Object

This class extends MapFragment and adds support for 3D venues.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in VenueMapFragment
Nested Classes

public static abstract interface VenueMapFragment.VenueListener

public static abstract interface VenueMapFragment.VenueZoomListener

Represents a listener to provide notification of the venue service's status upon its initialization.

Constructor Summary

Table 2. Constructors in VenueMapFragment
Constructors

VenueMapFragment ()

Constructor

Method Summary

Table 3. Methods in VenueMapFragment
Methods

public void addListener (VenueListener listener)

This method adds the VenueMapFragment.VenueListener object provided by the caller to the list of active listeners.

This method overrides venues3d.VenueLayerAdapter.addListener(VenueMapFragment, VenueListener)

public void addVenueZoomListener (VenueZoomListener listener)

Adds the VenueMapFragment.VenueZoomListener object to the list of active listeners.

This method overrides venues3d.VenueLayerAdapter.addVenueZoomListener(VenueMapFragment, VenueZoomListener)

public boolean cancelVenueSelection ()

This method attempts to cancel all Venue loading and selection that may be currently in progress.

This method overrides venues3d.VenueLayerAdapter.cancelVenueSelection(void)

public void deselectVenue ()

This method deselects the currently selected Venue.

This method overrides venues3d.VenueLayerAdapter.deselectVenue(void)

public Margin getMargin ()

This method retrieves the margins for the current venue view in screen pixels.

This method overrides venues3d.VenueLayerAdapter.getMargin(void)

public PositionIndicator getPositionIndicator ()

Returns the PositionIndicator instance that renders the current position with a marker.

This method overrides venues3d.VenueLayerAdapter.getPositionIndicator(void)

public RoutingController getRoutingController ()

This method retrieves a RoutingController object, which can be used to search and get IRouteSection objects.

This method overrides venues3d.VenueLayerAdapter.getRoutingController(void)

public Venue getSelectedVenue ()

This method retrieves the selected Venue object.

This method overrides venues3d.VenueLayerAdapter.getSelectedVenue(void)

public VenueController getVenueController (Venue venue)

This method retrieves the instance of VenueController for the Venue specified by the caller.

This method overrides venues3d.VenueLayerAdapter.getVenueController(Venue)

public VenueService getVenueService ()

This method retrieves a VenueService object, which can be used to search and get Venue objects.

This method overrides venues3d.VenueLayerAdapter.getVenueService(void)

public void init (OnEngineInitListener listener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

public void init (Context context, OnEngineInitListener listener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

public void init (OnEngineInitListener listener, VenueServiceListener serviceListener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

public void init (Context context, OnEngineInitListener listener, VenueServiceListener serviceListener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

public void init (Context context, MapVariant variant, OnEngineInitListener listener, VenueServiceListener serviceListener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

public boolean isFloorChangingAnimationEnabled ()

This method retrieves a Boolean value indicating whether floor-change animation is enabled.

This method overrides venues3d.VenueLayerAdapter.isFloorChangingAnimationEnabled(void)

public boolean isHideIconOnSelectedSpaceEnabled ()

Check if the icon on a space is hidden when the space is selected.

This method overrides venues3d.VenueLayerAdapter.isHideIconOnSelectedSpaceEnabled(void)

public boolean isOpenModeEnabled ()

This method retrieves a Boolean indicating if the open mode is enabled.

This method overrides venues3d.VenueLayerAdapter.isOpenModeEnabled(void)

public boolean isVenueEnteringAnimationEnabled ()

This method retrieves a Boolean value indicating whether venue-entry animation is enabled.

This method overrides venues3d.VenueLayerAdapter.isVenueEnteringAnimationEnabled(void)

public boolean isVenueInViewportCallbackEnabled ()

This method obtains a Boolean value indicating whether onVenueVisibleInViewport(Venue, boolean) messages are sent to objects registered as VenueMapFragment.VenueListener.

This method overrides venues3d.VenueLayerAdapter.isVenueInViewportCallbackEnabled(void)

public boolean isVenueLayerVisible ()

This method retrieves a Boolean indicating the visibility of the venues (the venue layer) on the map.

This method overrides venues3d.VenueLayerAdapter.isVenueLayerVisible(void)

public boolean isVenueVisible (String id)

This method checks if a Venue is visible.

This method overrides venues3d.VenueLayerAdapter.isVenueVisible(String)

public void onDestroy ()

For documentation, see java.lang.Object

public void onPause ()

Called when this fragment is no longer resumed.

This method overrides mapping.MapFragment.onPause(void)

public void onResume ()

Called when this fragment is visible to the user and actively running.

This method overrides mapping.MapFragment.onResume(void)

public void removeListener (VenueListener listener)

This method removes the VenueMapFragment.VenueListener object provided by the caller from the list of listeners, which receive the venue and space related events.Removes given VenueMapFragment.VenueZoomListener object from the list of listeners, which receive the Venue Zoom related events.

This method overrides venues3d.VenueLayerAdapter.removeListener(VenueMapFragment, VenueListener)

public void removeListener (VenueZoomListener listener)

This method removes the VenueMapFragment.VenueListener object provided by the caller from the list of listeners, which receive the venue and space related events.Removes given VenueMapFragment.VenueZoomListener object from the list of listeners, which receive the Venue Zoom related events.

This method overrides venues3d.VenueLayerAdapter.removeListener(VenueMapFragment, VenueZoomListener)

public VenueInfo selectAsync (String venueId, String spaceId)

This method selects a Venue and a Space within it in a 3D view mode.

This method overrides venues3d.VenueLayerAdapter.selectAsync(String, String)

public boolean selectVenue (Venue venue)

This method selects the Venue in a 3D view mode.

This method overrides venues3d.VenueLayerAdapter.selectVenue(Venue)

public VenueInfo selectVenueAsync (String id)

This method uses the id provided by the caller to select the corresponding venue in a 3D view mode.

This method overrides venues3d.VenueLayerAdapter.selectVenueAsync(String)

public void setFloorChangingAnimation (boolean enabled)

This method controls whether or not an animation is used on floor change.

This method overrides venues3d.VenueLayerAdapter.setFloorChangingAnimation(boolean)

public void setHideIconOnSelectedSpaceEnabled (boolean value)

Control if the icon on a space should be hidden when the space is selected.

This method overrides venues3d.VenueLayerAdapter.setHideIconOnSelectedSpaceEnabled(boolean)

public void setMargin (Margin value)

This method sets the margins for the current venue view in screen pixels.

This method overrides venues3d.VenueLayerAdapter.setMargin(Margin)

public void setOpenModeEnabled (boolean value)

This method sets a flag indicating whether or not the open mode is enabled.

This method overrides venues3d.VenueLayerAdapter.setOpenModeEnabled(boolean)

public void setVenueEnteringAnimation (boolean enabled)

This method enables or disables an animation used when the venue is opened.

This method overrides venues3d.VenueLayerAdapter.setVenueEnteringAnimation(boolean)

public void setVenueLayerVisible (boolean value)

This method sets a flag indicating whether or not the venue layer is visible.

This method overrides venues3d.VenueLayerAdapter.setVenueLayerVisible(boolean)

public void setVenuesInViewportCallback (boolean enabled)

This method a flag to indicate whether onVenueVisibleInViewport(Venue, boolean) messages are to be sent to objects registered as VenueMapFragment.VenueListener.

This method overrides venues3d.VenueLayerAdapter.setVenuesInViewportCallback(boolean)

Class Details

This class extends MapFragment and adds support for 3D venues. It allows Venues such as shopping malls and airports to be shown on the map as interactive 3D models. In addition, it enables the display of spaces inside venues and of venue access information (such as information about entrances).

An instance of VenueMapFragment must be initialized by calling its init(OnEngineInitListener, VenueServiceListener) method. To enable interactive use an instance of VenueMapFragment , add listeners for relevant events to the it as shown in the example below.


 VenueMapFragment mapFragment = (VenueMapFragment)
   getFragmentManager().findFragmentById(R.id.map_fragment); mapFragment.init(null, new VenueServiceListener() {
   public void onInitializationCompleted(InitStatus result) {
     if (result == InitStatus.ONLINE_SUCCESS ||
       result == InitStatus.OFFLINE_SUCCESS)
     {
       mapFragment.addListener(venueListener);
     }
   }   public void onGetVenueCompleted(Venue venue) {
   }
 }); // Venue can then be opened on a tap event:
 public void onVenueTapped(Venue venue, float x, float y) {
   mapFragment.openVenue(venue);
 }
  

See MapFragment API documentation for more information about the life cycle of the fragment and how to use it in a layout file.

A VenueMapFragment is an add-on to the base map functionality with its own content loading and cache. For this reason, if a fragment is not already present in the cache, it needs to be downloaded before it can be displayed and therefore a small delay may occur before the venue appears on the the map.

Constructor Details

VenueMapFragment ()

Constructor

Method Details

public void addListener (VenueListener listener)

This method adds the VenueMapFragment.VenueListener object provided by the caller to the list of active listeners. The VenueListener object contains method implementations for handling venue- and space-related events, such as selecting and deselecting a venue.

This method overrides venues3d.VenueLayerAdapter.addListener(VenueMapFragment, VenueListener)

Parameters:

  • listener

public void addVenueZoomListener (VenueZoomListener listener)

Adds the VenueMapFragment.VenueZoomListener object to the list of active listeners. The VenueZoomListener object contains method implementation for handling Venue Zoom activation and deactivation notification.

This method overrides venues3d.VenueLayerAdapter.addVenueZoomListener(VenueMapFragment, VenueZoomListener)

Parameters:

  • listener

public boolean cancelVenueSelection ()

This method attempts to cancel all Venue loading and selection that may be currently in progress.

This method overrides venues3d.VenueLayerAdapter.cancelVenueSelection(void)

public void deselectVenue ()

This method deselects the currently selected Venue.

This method overrides venues3d.VenueLayerAdapter.deselectVenue(void)

public Margin getMargin ()

This method retrieves the margins for the current venue view in screen pixels.

This method overrides venues3d.VenueLayerAdapter.getMargin(void)

public PositionIndicator getPositionIndicator ()

Returns the PositionIndicator instance that renders the current position with a marker. The position indicator should be used with PositioningManager.

This method overrides venues3d.VenueLayerAdapter.getPositionIndicator(void)

public RoutingController getRoutingController ()

This method retrieves a RoutingController object, which can be used to search and get IRouteSection objects.

This method overrides venues3d.VenueLayerAdapter.getRoutingController(void)

public Venue getSelectedVenue ()

This method retrieves the selected Venue object.

This method overrides venues3d.VenueLayerAdapter.getSelectedVenue(void)

public VenueController getVenueController (Venue venue)

This method retrieves the instance of VenueController for the Venue specified by the caller.

This method overrides venues3d.VenueLayerAdapter.getVenueController(Venue)

Parameters:

  • venue

public VenueService getVenueService ()

This method retrieves a VenueService object, which can be used to search and get Venue objects.

This method overrides venues3d.VenueLayerAdapter.getVenueService(void)

public void init (OnEngineInitListener listener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

This method will initialize MapEngine with GLOBAL map variant on first SDK usage and with stored map variant on sub-sequent usages.

Note that even after engine initialization, most VenueMapFragment features cannot be used until VenueService is ready. Listen for this ready status by using VenueServiceListener.onInitializationCompleted(InitStatus).

Due to this requirement, it is recommended to use init(OnEngineInitListener, VenueServiceListener) for most cases instead.

Parameters:

  • listener

See also:

init(OnEngineInitListener, VenueServiceListener)

public void init (Context context, OnEngineInitListener listener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle.

This method will initialize MapEngine with GLOBAL map variant on first SDK usage and with stored map variant on sub-sequent usages.

Note that even after engine initialization, most VenueMapFragment features cannot be used until VenueService is ready. Listen for this ready status by using VenueServiceListener.onInitializationCompleted(InitStatus).

Due to this requirement, it is recommended to use init(Context, OnEngineInitListener, VenueServiceListener) for most cases instead.

Parameters:

  • context
  • listener

See also:

init(Context, OnEngineInitListener, VenueServiceListener)

public void init (OnEngineInitListener listener, VenueServiceListener serviceListener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle. Users of VenueMapFragment should call this method after the fragment is first attached to its activity.

This method will initialize MapEngine with GLOBAL map variant on first SDK usage and with stored map variant on sub-sequent usages.

This method can be used for VenueMapFragment objects that are created programatically or declared in a layout XML file.

Parameters:

  • listener

    A OnEngineInitListener object that will be called when VenueMapFragment initialization is finished. A null object can be supplied if the caller does not require any notification when initialization completes.

  • serviceListener

    A VenueService.VenueServiceListener object that will be called when VenueService initialization is finished. Venue related calls should be made only after the user receives the callback VenueServiceListener.onInitializationCompleted(InitStatus). A null object can be supplied if the caller does not require any notification when initialization completes.

See also:

OnEngineInitListener

VenueService.VenueServiceListener

init(Context, OnEngineInitListener)

init(Context, OnEngineInitListener)

init(Context, OnEngineInitListener, VenueServiceListener)

public void init (Context context, OnEngineInitListener listener, VenueServiceListener serviceListener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle. Users of VenueMapFragment should call this method after the fragment is first attached to its activity.

This method will initialize MapEngine with GLOBAL map variant on first SDK usage and with stored map variant on sub-sequent usages.

Parameters:

  • context

    The application context of this fragment.

  • listener

    A OnEngineInitListener object that will be called when VenueMapFragment initialization is finished. A null object can be supplied if the caller does not require any notification when initialization completes.

  • serviceListener

    A VenueService.VenueServiceListener object that will be called when VenueService initialization is finished. Venue related calls should be made only after the user receives the callback VenueServiceListener.onInitializationCompleted(InitStatus). A null object can be supplied if the caller does not require any notification when initialization completes.

See also:

OnEngineInitListener

VenueService.VenueServiceListener

init(Context, OnEngineInitListener)

init(OnEngineInitListener)

init(OnEngineInitListener, VenueServiceListener)

public void init (Context context, MapVariant variant, OnEngineInitListener listener, VenueServiceListener serviceListener)

Initializes the MapEngine and VenueService and displays a map that occupies the entire MapFragment's view rectangle. Users of VenueMapFragment should call this method after the fragment is first attached to its activity.

This method can be used for VenueMapFragment objects that are created programatically or declared in a layout XML file.

This method can configure map variant which will be used by MapEngine. If initialization fails - OPERATION_NOT_ALLOWED will be reported. Currently following variants are supported: - GLOBAL - initialize MapEngine to use international map variant; - KOREA - initialize MapEngine to use Korean map variant; - null - initialize MapEngine to use stored map variant or international map variant for first run. This method is used to configure MapEngine to use certain map variant. If MapEngine was already configured and passed variant differs - error will be reported and initialization fails.

Parameters:

  • context

    The application context of this fragment.

  • variant

    Map variant to use.

  • listener

    A OnEngineInitListener object that will be called when VenueMapFragment initialization is finished. A null object can be supplied if the caller does not require any notification when initialization completes.

  • serviceListener

    A VenueService.VenueServiceListener object that will be called when VenueService initialization is finished. Venue related calls should be made only after the user receives the callback VenueServiceListener.onInitializationCompleted(InitStatus). A null object can be supplied if the caller does not require any notification when initialization completes.

See also:

OnEngineInitListener

VenueService.VenueServiceListener

init(Context, OnEngineInitListener)

init(OnEngineInitListener)

init(OnEngineInitListener, VenueServiceListener)

public boolean isFloorChangingAnimationEnabled ()

This method retrieves a Boolean value indicating whether floor-change animation is enabled.

This method overrides venues3d.VenueLayerAdapter.isFloorChangingAnimationEnabled(void)

public boolean isHideIconOnSelectedSpaceEnabled ()

Check if the icon on a space is hidden when the space is selected.

This method overrides venues3d.VenueLayerAdapter.isHideIconOnSelectedSpaceEnabled(void)

public boolean isOpenModeEnabled ()

This method retrieves a Boolean indicating if the open mode is enabled. By default the open mode is disabled. In the open mode a user can see outer areas and spaces all the time. A selected floor and a floor stack is always shown. Venues are selected automatically.

This method overrides venues3d.VenueLayerAdapter.isOpenModeEnabled(void)

public boolean isVenueEnteringAnimationEnabled ()

This method retrieves a Boolean value indicating whether venue-entry animation is enabled.

This method overrides venues3d.VenueLayerAdapter.isVenueEnteringAnimationEnabled(void)

public boolean isVenueInViewportCallbackEnabled ()

This method obtains a Boolean value indicating whether onVenueVisibleInViewport(Venue, boolean) messages are sent to objects registered as VenueMapFragment.VenueListener.

This method overrides venues3d.VenueLayerAdapter.isVenueInViewportCallbackEnabled(void)

public boolean isVenueLayerVisible ()

This method retrieves a Boolean indicating the visibility of the venues (the venue layer) on the map.

This method overrides venues3d.VenueLayerAdapter.isVenueLayerVisible(void)

public boolean isVenueVisible (String id)

This method checks if a Venue is visible. It can be used to check if the venue layer has loaded and displayed a specific venue on the map.

This method overrides venues3d.VenueLayerAdapter.isVenueVisible(String)

Parameters:

  • id

public void onDestroy ()

For documentation, see java.lang.Object

public void onPause ()

Called when this fragment is no longer resumed. All MapEngine activities will be paused automatically.

This method overrides mapping.MapFragment.onPause(void)

public void onResume ()

Called when this fragment is visible to the user and actively running. All MapEngine activities will be resumed automatically.

This method overrides mapping.MapFragment.onResume(void)

public void removeListener (VenueListener listener)

This method removes the VenueMapFragment.VenueListener object provided by the caller from the list of listeners, which receive the venue and space related events.Removes given VenueMapFragment.VenueZoomListener object from the list of listeners, which receive the Venue Zoom related events.

This method overrides venues3d.VenueLayerAdapter.removeListener(VenueMapFragment, VenueListener)

Parameters:

  • listener

public void removeListener (VenueZoomListener listener)

This method removes the VenueMapFragment.VenueListener object provided by the caller from the list of listeners, which receive the venue and space related events.Removes given VenueMapFragment.VenueZoomListener object from the list of listeners, which receive the Venue Zoom related events.

This method overrides venues3d.VenueLayerAdapter.removeListener(VenueMapFragment, VenueZoomListener)

Parameters:

  • listener

public VenueInfo selectAsync (String venueId, String spaceId)

This method selects a Venue and a Space within it in a 3D view mode. The venue and space must match their respective ids as provided by the caller. In the 3D view mode layers and spaces of the venue are visible for the application user. The method is asynchronous, because the venue must be downloaded if it is not already present in the cache. onVenueSelected(Venue) callback method is called when the venue have been selected.

This method overrides venues3d.VenueLayerAdapter.selectAsync(String, String)

Parameters:

  • venueId
  • spaceId

public boolean selectVenue (Venue venue)

This method selects the Venue in a 3D view mode. In the 3D view mode, layers and spaces of the venue are visible to the application user. This method opens an already donwloaded venue. onVenueSelected(Venue) callback method is called when the venue has been selected.

This method overrides venues3d.VenueLayerAdapter.selectVenue(Venue)

Parameters:

  • venue

public VenueInfo selectVenueAsync (String id)

This method uses the id provided by the caller to select the corresponding venue in a 3D view mode. In the 3D view mode, layers and spaces of the venue are visible for the application user. The method is asynchronous, because the venue must be downloaded if it is not already present in the cache. The callback method onVenueSelected(Venue) is called when the venue have been selected.

This method overrides venues3d.VenueLayerAdapter.selectVenueAsync(String)

Parameters:

  • id

public void setFloorChangingAnimation (boolean enabled)

This method controls whether or not an animation is used on floor change. Visible floors can be changed by tapping one of them or by using the venue selector widget. By default animation is not used.

This method overrides venues3d.VenueLayerAdapter.setFloorChangingAnimation(boolean)

Parameters:

  • enabled

public void setHideIconOnSelectedSpaceEnabled (boolean value)

Control if the icon on a space should be hidden when the space is selected.

This method overrides venues3d.VenueLayerAdapter.setHideIconOnSelectedSpaceEnabled(boolean)

Parameters:

  • value

public void setMargin (Margin value)

This method sets the margins for the current venue view in screen pixels. The defaults are (0, 0, 0, 0).

This method overrides venues3d.VenueLayerAdapter.setMargin(Margin)

Parameters:

  • value

public void setOpenModeEnabled (boolean value)

This method sets a flag indicating whether or not the open mode is enabled. By default the open mode is disabled. In the open mode a user can see outer areas and spaces all the time. A selected floor and a floor stack is always shown. Venues are selected automatically.

Updating the open mode is done in the background, so changes to this property may not be immediately reflected in its value. Changes to this property will deselect a selected venue.

This method overrides venues3d.VenueLayerAdapter.setOpenModeEnabled(boolean)

Parameters:

  • value

public void setVenueEnteringAnimation (boolean enabled)

This method enables or disables an animation used when the venue is opened. A visible venue can be entered (opened) by tapping on it. By default animation is not used.

This method overrides venues3d.VenueLayerAdapter.setVenueEnteringAnimation(boolean)

Parameters:

  • enabled

public void setVenueLayerVisible (boolean value)

This method sets a flag indicating whether or not the venue layer is visible. By default venues are visible.

This method overrides venues3d.VenueLayerAdapter.setVenueLayerVisible(boolean)

Parameters:

  • value

public void setVenuesInViewportCallback (boolean enabled)

This method a flag to indicate whether onVenueVisibleInViewport(Venue, boolean) messages are to be sent to objects registered as VenueMapFragment.VenueListener. By default the message is not sent.

This method overrides venues3d.VenueLayerAdapter.setVenuesInViewportCallback(boolean)

Parameters:

  • enabled

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.