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

public boolean isVenueEnteringAnimationEnabled ()

public boolean isVenueInViewportCallbackEnabled ()

public boolean isVenueLayerVisible ()

public boolean isVenueVisible (String id)

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)

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 setMargin (Margin 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 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.

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.

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 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 can be used for VenueMapFragment objects that are created programatically or declared in a layout XML file.

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

public boolean isVenueEnteringAnimationEnabled ()

public boolean isVenueInViewportCallbackEnabled ()

public boolean isVenueLayerVisible ()

public boolean isVenueVisible (String id)

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)

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 setMargin (Margin value)

Parameters:

  • value

public void setVenueEnteringAnimation (boolean enabled)

Parameters:

  • enabled

public void setVenueLayerVisible (boolean value)

Parameters:

  • value

public void setVenuesInViewportCallback (boolean enabled)

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.