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)

public void addVenueZoomListener (VenueZoomListener listener)

public boolean cancelVenueSelection ()

public void deselectVenue ()

public Margin getMargin ()

public VenueNavigationManager getNavigationManager ()

public PositionIndicator getPositionIndicator ()

public RoutingController getRoutingController ()

public Venue getSelectedVenue ()

public VenueController getVenueController (Venue venue)

public VenueService getVenueService ()

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 ()

public boolean isHideIconOnSelectedSpaceEnabled ()

public boolean isOpenModeEnabled ()

public boolean isVenueEnteringAnimationEnabled ()

public boolean isVenueInViewportCallbackEnabled ()

public boolean isVenueLayerVisible ()

public boolean isVenueVisible (String id)

public void onDestroy ()

public void onPause ()

public void onResume ()

public void removeListener (VenueListener listener)

public void removeListener (VenueZoomListener listener)

public VenueInfo selectAsync (String venueId, String spaceId)

public boolean selectVenue (Venue venue)

public VenueInfo selectVenueAsync (String id)

public void setFloorChangingAnimation (boolean enabled)

public void setHideIconOnSelectedSpaceEnabled (boolean value)

public void setMargin (Margin value)

public void setOpenModeEnabled (boolean value)

public void setVenueEnteringAnimation (boolean enabled)

public void setVenueLayerVisible (boolean value)

public void setVenuesInViewportCallback (boolean enabled)

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)

Parameters:

  • listener

public void addVenueZoomListener (VenueZoomListener listener)

Parameters:

  • listener

public boolean cancelVenueSelection ()

public void deselectVenue ()

public Margin getMargin ()

public VenueNavigationManager getNavigationManager ()

public PositionIndicator getPositionIndicator ()

public RoutingController getRoutingController ()

public Venue getSelectedVenue ()

public VenueController getVenueController (Venue venue)

Parameters:

  • venue

public VenueService getVenueService ()

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 ()

public boolean isHideIconOnSelectedSpaceEnabled ()

public boolean isOpenModeEnabled ()

public boolean isVenueEnteringAnimationEnabled ()

public boolean isVenueInViewportCallbackEnabled ()

public boolean isVenueLayerVisible ()

public boolean isVenueVisible (String id)

Parameters:

  • id

public void onDestroy ()

public void onPause ()

public void onResume ()

public void removeListener (VenueListener listener)

Parameters:

  • listener

public void removeListener (VenueZoomListener listener)

Parameters:

  • listener

public VenueInfo selectAsync (String venueId, String spaceId)

Parameters:

  • venueId
  • spaceId

public boolean selectVenue (Venue venue)

Parameters:

  • venue

public VenueInfo selectVenueAsync (String id)

Parameters:

  • id

public void setFloorChangingAnimation (boolean enabled)

Parameters:

  • enabled

public void setHideIconOnSelectedSpaceEnabled (boolean value)

Parameters:

  • value

public void setMargin (Margin value)

Parameters:

  • value

public void setOpenModeEnabled (boolean value)

Parameters:

  • value

public void setVenueEnteringAnimation (boolean enabled)

Parameters:

  • enabled

public void setVenueLayerVisible (boolean value)

Parameters:

  • value

public void setVenuesInViewportCallback (boolean enabled)

Parameters:

  • enabled