
Last summer, we
talked about our attempt to facilitate the orientation process in the office, which resulted in the creation of a map where you can see the location of all the company's employees. Since then, we moved to a new office, so (well, because I wanted to do everything even better), it was decided to redesign the map taking into account the accumulated experience.
We briefly recall why we even needed to create a map of our office. Our company has been developing quite rapidly in recent years, and the number of employees is constantly increasing (now we have more than 300 people). Accordingly, finding a colleague you need among so many people is not easy, and using a map you can easily find out exactly where he is sitting in the office. Often it is necessary to solve the inverse problem: it happens that visually a person is familiar, and the location of his workplace is known, but neither the name nor the email address can be remembered. This data can be obtained by clicking on the desired table on the map.
It was -> became
In general, the map was redone a little more than completely. This was facilitated not only by the desire of developers to improve those moments that have long been an improvement, but also some technical and legal aspects, which will be discussed below.
')
New engine
The old version of the map was well scaled and, in principle, nothing prevented us from using it after the move. However, in the comments to the previous article, we were
told that the Yandex.Maps API user agreement, on the basis of which the previous version worked, cannot be used as we did. Yandex support confirmed this fact, and - since we are law-abiding people - it was decided to “move” from Yandex maps to the open source
Leaflet map display engine.
By the way, in the actual at that time version of Leaflet 0.4.3 there was no flat projection we needed, and we had to implement it on our own. In the current version 0.5, this functionality is present, but the coordinates are calculated a little differently from ours. Therefore, our map is still working on an older version of the engine.
In the comments to the previous post, we were also advised to pay attention to several other graphics engine options (right up to Planner 5D), but nevertheless won Leaflet, with a small margin ahead of
OpenLayers .
The main difficulty in developing a new map was the export of tables (that is, the data that represent them) from AutoCAD to the database. On the one hand, it was not mandatory, because you can simply arrange the tables immediately on the map. But on the other hand, since the tables do not stand smoothly, but who turned where, they would have had to manually “twirl” a bunch of tables, which I didn’t want to do.
As a result, a scheme was implemented that works as follows:
- In AutoCAD, tables moved to a separate layer.
- This layer was processed by a special Lisp script (we found it on the Internet; just in case, here it is ), which exported the data in its own format.
- Further, these data came in as input to a python script (it was easier to deal with it), which translated them into an SQL insert script into the database. At the same stage, there was a recalculation of the table correspondence coordinates from AutoCAD terms, to Leaflet terms.
If it was necessary to "finish" some objects that were not originally (negotiation, etc.), then the scheme was repeated: creating an object in an autocade → moving it to a separate layer → exporting data using a lispovy script → converting to SQL → inserting into a database .
As a result, the appearance of the map has changed.
It was:

It became:

The map is located on the intranet portal of the company with which its data is synchronized according to the schedule.
Relocation of employees
In the previous version of the card, in order to “transplant” an employee, it was necessary to physically move the tables on the map with the mouse, and there was no possibility of reassigning the employee to a specific table. In other words, it was impossible the situation when the table remains in place, and only the employee who sits behind him changes. At that stage, it was only important for us to find out the most important thing: whether people need a card, whether they will use it, so we made everything as simple as possible.
In principle, there is nothing wrong with that, but only the developer could perform the copying of the table. Considering that the mission of maintaining the relevance of the card was planned to be entrusted to the personnel department, it was necessary to simplify the process of working with the card as much as possible: the company employs 300 people who periodically move from place to place and track all these movements without that easy.
As a result, now the personnel department employees need only click on the table on the map and select from the drop-down list the employee who will sit behind him.

Introducing Custom Roles
Another innovation - login when working with the card. The previous version was static, which made the use of authentication impossible. The current version of the card is an MVC application that allows you to implement functions specific to the server application (access rights, “transplanting”, “finding my desk”, etc.).
For authentication, we use the NTLM mechanism built into ASP.NET and an uncomplicated samopisnuyu role system that allows you to specify groups directly in the application configuration.

Now, by the way, there is no possibility of drawing new tables on the map. Due to the fact that there are more tables in the new office than employees and the organization of new jobs is not planned for a while, this function will not be required for some time. Although the thing, of course, necessary, and we are going to implement it in the future.
Plans
Most recently, we conducted a survey among colleagues, as a result of which we managed to collect a large number of ideas. Among them were original proposals, for example, to photograph the entire office and make a panorama of it (like Google Street View), so that you can make virtual walks around the office, but so far the expediency of this innovation is put into question by map developers :).
In addition, the plans include:
- Realization of the possibility of booking a table by the staff of the personnel department for a new employee in advance, while he has not yet come to work and has not yet opened an account in Active Directory.
- Implementation of the possibility of drawing tables on the map (can be done using https://github.com/Leaflet/Leaflet.draw ).
- Add printers, first aid kits and other potentially necessary objects. The first steps in this direction have already been taken: meeting rooms, telephone booths, a library, and a wall for drawing with a marker appeared on the map.
There are other ideas of varying degrees of elaboration and necessity: layers on the map (for example, with the same printers and other office equipment) or integration with MS Exchange (when clicking on a conversation, show when and by whom it is busy and when it is free, when clicking on employee to display scheduled meetings from the calendar). In the future, perhaps we will implement some of this.
Demo
In the comments to the last article we were asked to show, in fact, the map itself. We managed to make a
demo , but considering that this is still an internal project of the company, located on the intranet and not accessible from the outside, the functionality of the public version is limited.
UPD : Laid out the
source .
We will be happy to answer questions in the comments. Always yours,
MikeOzornin and
evgekon map developers