Developer

Updating the LOD factor

Arrow navigation

Go back

Updating the LOD factor

A how to guide for fine tuning LOD factor which determines when the LOD would change when viewing the map with a Visioglobe SDK.

Introduction

The ability to display certain information depending on the maps zoom level is available within all the Visioglobe SDKs.

To achieve this, when the map is created, each floor may have several Level Of Details (LODs) associated with it.  Below, we see three screenshots (taken from VisioMapEditor) that show three different LODs for the same floor.  As the LOD increases, we see more detail within the map.  A map is very simple, it might only have one LOD or if a map is very complicated, it might have four or five.

visioisland.lod0
LOD 0 (Basic)
visioisland.lod1
LOD1
visioisland.lod2
LOD2 (Detailed)

When viewing the map via a Visioglobe SDK, one LOD will be displayed at a time.  When the user zooms in and out of the map, the SDK will automatically determine which LOD to display.

In some cases, it might be interesting to fine tune when the SDK should change the LOD.  For example, below in figure 1, the highest level of detail is display but it's difficult to read the labels above the places.  By reducing the map's LOD factor, we can delay when the most detailed LOD is displayed as the user zooms into the map. (figure 2).  This means the user must zoom further into the map before the next (and more detailed LOD), is displayed.

lod.2
figure 1: LOD Factor by default displays the maps LOD 2 for the given map zoom level
lod.1
figure 2: For the same zoom level, reducing the LOD Factor now displays LOD 1

Modifying LOD Factor

For each Visioglobe SDK, I'll explain how it's possible to alter the LOD factor.

VisioMove

Within the VisioMove SDK, the LOD factor can be changed via the VgLayer::setLodFactor() API.

VisioKiosk

Within the VisioKiosk SDK, the lod factor is determined by the lodFactor member variable. By default this value is 1 but it's possible to change it in order change the LOD factor. For example:

// Would mean you would have to zoom out further before the LOD 0 was shown.mapviewer.lodFactor = 2// Would mean you would have to zoom in really close before LOD 2 was shown.mapviewer.lodFactor = 0.5

Tip: You can play around with these values in your browser's javascript console for quickly testing how it works.

VisioWeb

The map displayed within the VisioWeb SDK, only ever has a single LOD (the map's most detailed LOD).