2GIS Project Detection Module

Project is agglomeration, which includes a major city and the surrounding areas. This plugin allows to get information about the project which is being viewed at the current moment of time.

Examples of usage

Subscribe to the projectchange event:

map.on('projectchange', function (e) {
    console.log(e);
});

Subscribe to the projectleave event:

map.on('projectleave', function (e) {
   console.log(e);
});

Events

Event Data Description
projectchange ProjectEvent Occurs when the user goes from one project to another.
projectleave ProjectEvent Occurs when the user is outside of the current project.

Methods

Method Returns Description
getProjectList Object Returns all available projects.
getProject Object Returns the current project.