Skip to content

Commit 8cb88f0

Browse files
committed
Show other markers on the map in the edit mode
Resolves #482
1 parent 829db2e commit 8cb88f0

3 files changed

Lines changed: 43 additions & 3 deletions

File tree

public/js/module/map/map.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,30 @@ define([
626626

627627
// Обработчик переключения режима редактирования
628628
editHandler: function (edit) {
629+
const self = this;
630+
629631
if (edit) {
630-
this.pointHighlightDestroy().pointEditCreate().markerManager.disable();
632+
let highlightedPhotoLayer;
633+
634+
this.markerManager.layerPhotos.eachLayer(function (marker) {
635+
if (_.isEqual(self.point.geo(), marker.options.data.obj.geo)) {
636+
highlightedPhotoLayer = marker;
637+
}
638+
639+
marker
640+
.off('click')
641+
.off('mouseover');
642+
});
643+
644+
if (highlightedPhotoLayer) {
645+
this.markerManager.layerPhotos.removeLayer(highlightedPhotoLayer);
646+
}
647+
648+
this.pointHighlightDestroy().pointEditCreate();
631649
} else {
632-
this.pointEditDestroy().pointHighlightCreate().markerManager.enable();
650+
this.markerManager.disable();
651+
this.pointEditDestroy().pointHighlightCreate();
652+
this.markerManager.enable();
633653
}
634654
},
635655
// Включает режим редактирования

public/style/map/map.less

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,26 @@
892892
}
893893

894894
.mapContainer.embedded {
895+
&.editing {
896+
.clusterIcon {
897+
display: none !important;
898+
}
899+
900+
.clusterIconLocal,
901+
.photoIcon {
902+
.opacity(0.4);
903+
cursor: grab;
904+
}
905+
906+
.photoIcon:hover {
907+
width: 8px !important;
908+
height: 8px !important;
909+
margin-left: -4px !important;
910+
margin-top: -4px !important;
911+
.box-shadow(0 0 1px 1px #fff);
912+
}
913+
}
914+
895915
.mapNavigation {
896916
top: -33px;
897917
left: -13px;

views/module/map/map.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.mapModuleWrapper(data-bind="with: repository[M!M]")
2-
.mapContainer(data-bind="css: {embedded: embedded}")
2+
.mapContainer(data-bind="css: {embedded: embedded, editing: editing}")
33
.map
44

55
//ko if: embedded

0 commit comments

Comments
 (0)