Each time a map is loaded using the Micello SDK for Leaflet, there are calls to the file server to retrieve the appropriate files to render the map. Unless specified, the latest active files are used to display the most, up to date map.

However, in some cases, the map or entity version is required to be explicitly set so a specific version of the map is loaded. 

What is the map and entity version?

Generally speaking, the map has two data sets included:

  • Map data: the actual physical appearance of the map such as the geometries, polygons, etc
  • Entity data : the occupants of the spaces on a map 

If either of these are updated prior to a release a map, the number is increased by one to denote a new version of data. 

Explicitly Setting The Version Numbers

There are three ways to set the version numbers at map load time.

Do Nothing At All

By default, the Micello SDK for Leaflet handles this at load time, sending a "wildcard" request, which asks the file server for the latest versions of the relevant files

Using the Community Options

At run time, when the SDK is loaded, the community options can be used to explicitly set the map version and/or entity version:

var map = L.map('map');
var community;
L.micello.loader.on("indoorReady", function (e) {
    community = L.micello.community ( 78, {
        key: <!--INSERT YOUR KEY HERE-->,
        mv: 43,
        ev: 44
    }).addTo(map);
});

Passing in via the URL

Immediately after the SDK has loaded and begins to assemble the URLs to call for the map files, the SDK will analyze the URL (if it exists) for specific name value pairs to exist.

If "mv" or "ev" exist in the query string, these will be used to load the map. 

For example: 

https://<webappURL>/app/go?mv=34&ev=36

The map version 34 and the entity version 36 would be used in this scenario.

(Note: The Javascript location object is used here, so if this object is not present in the application, this feature will not operate as expected.)

Map Files Active Status

Each of the map files in a given map has either an active or inactive status.

Map files with an inactive status can only be viewed when the map and entity version are explicitly set.

Map files with an active status can be viewed if the "wildcard" request is provided. 

For example, if map version 44 and entity version 40 was active and map version 45 and entity version 41 was inactive, any "wildcard" request for the latest map files would return map version 44 and entity version 40. However, if map version 45 and entity version 41 were explicitly requested using one of the manners above, the inactive map version could be viewed.

Map and Entity Version Combinations

The map and entity version combination has to exist in a map release for the map to load. The following are some uses and the potential outcome:

------------------------------------------------

Scenario: The map version is explicitly set and the entity version is not explicitly set.

Outcome: This will always work as the map version is always loaded first and the entity version associated with the explicitly set map version will be automatically found.

------------------------------------------------

Scenario: The entity version is explicitly set and the map version is not explicitly set

Outcome: There is a high risk of map load failure here as the latest map version (which is automatically loaded when it is not explicitly set) may not be associated with the explicitly set entity version since the map version is loaded first.

------------------------------------------------

Scenario: The map and entity version are both explicitly set.

Outcome: Provided these versions are associated in a given release, there is no risk of map load failure.