Micello maps will load to the ground floor of a community by default. If the map level needs to change as the result of a user event, the method setLevel() can be used. If the map needs to be originally loaded to a level other than the default, see the Set Map example.

Notice that the array index used to identify a level is not it's 'name' (floor 1), and may not be it's z-index ( on maps with basement levels ).

This example will use a click event to trigger the level change.

micello.maps.init (apikey, mapInit);
function  mapInit() {
    var mapControl =  new micello.maps.MapControl('mapElement');
    var mapDataObject = mapControl.getMapData();
    mapDataObject.mapChanged = onMapChanged;
document.getElementById("change_level").onclick = function () {
    var drawing = mapDataObject.getCurrentDrawing(); // get current drawing object

If the community has multiple drawings, only levels on drawings that have been loaded will be available. If a level is on another drawing within the map, set the drawing first, then set the level.

Try changing the index of the level above and clicking 'Change Level' (0 or 1).