Geovisualization Developer's Guide

H.datalens. VenueProvider

Class Summary

Extends: H.map.provider.RemoteTileProvider

Gets data from the Venue Maps API.

[ For full details, see the Class Details ]

Class Description

Allows you to load data from the Venue Maps API and connect it to a SpatialLayer or ObjectLayer to draw venue floor plans and optional labels.
let service = platform.getVenueService();
let provider = new H.datalens.VenueProvider(service, {currentLevel: 0});
let layer = new H.datalens.SpatialLayer(null, provider, {...});
map.addLayer(layer);

Constructor Details

H.datalens.VenueProvider (service, options)

Parameters:
 
service : { H.service.venues.Service | H.datalens.VenueService }
Venue Maps API service.
options : { H.datalens.VenueProvider.Options }
Initial configuration for VenueProvider, such as the current floor level.

Method Details

getNamespace () : { string }

namespace getter

Returns:
 
: { string }

getLabelProvider () : { H.map.provider.RemoteTileProvider }

Creates a provider which outputs venue labels as an array of GeoJson points and is synchronized with source VenueProvider.
let labelLayer = new H.datalens.ObjectLayer(
   provider.getLabelProvider(),
   {
     rowToMapObject: (feature) => {
       let [lng, lat] = feature.geometry.coordinates;
       return new H.map.Marker({lat, lng});
     }
   }
 );
Returns:
 
: { H.map.provider.RemoteTileProvider }
label provider

setCurrentLevel (currentLevel)

Updates current floor level.
provider.setCurrentLevel(provider.getCurrentLevel() + 1);
 provider.reload();
Parameters:
 
currentLevel : { number } [optional]
current floor level

getCurrentLevel () : { number }

Retrieves current floor level.

Returns:
 
: { number }