Skip to content

Commit

Permalink
Show other markers on the map in the edit mode
Browse files Browse the repository at this point in the history
Resolves #482
  • Loading branch information
circus2271 committed Mar 4, 2023
1 parent 829db2e commit 33c10df
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
24 changes: 22 additions & 2 deletions public/js/module/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,30 @@ define([

// Обработчик переключения режима редактирования
editHandler: function (edit) {
const self = this;

if (edit) {
this.pointHighlightDestroy().pointEditCreate().markerManager.disable();
let highlightedPhotoLayer;

this.markerManager.layerPhotos.eachLayer(function (marker) {
if (_.isEqual(self.point.geo(), marker.options.data.obj.geo)) {
highlightedPhotoLayer = marker;
}

marker
.off('click')
.off('mouseover');
});

if (highlightedPhotoLayer) {
this.markerManager.layerPhotos.removeLayer(highlightedPhotoLayer);
}

this.pointHighlightDestroy().pointEditCreate();
} else {
this.pointEditDestroy().pointHighlightCreate().markerManager.enable();
this.markerManager.disable();
this.pointEditDestroy().pointHighlightCreate();
this.markerManager.enable();
}
},
// Включает режим редактирования
Expand Down
20 changes: 20 additions & 0 deletions public/style/map/map.less
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@
}

.mapContainer.embedded {
&.editing {
.clusterIcon {
display: none !important;
}

.clusterIconLocal,
.photoIcon {
cursor: grab;
.opacity(0.4);
}

.photoIcon:hover {
width: 8px !important;
height: 8px !important;
margin-left: -4px !important;
margin-top: -4px !important;
.box-shadow(0 0 1px 1px #fff);
}
}

.mapNavigation {
top: -33px;
left: -13px;
Expand Down
2 changes: 1 addition & 1 deletion views/module/map/map.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.mapModuleWrapper(data-bind="with: repository[M!M]")
.mapContainer(data-bind="css: {embedded: embedded}")
.mapContainer(data-bind="css: {embedded: embedded, editing: editing}")
.map

//ko if: embedded
Expand Down

0 comments on commit 33c10df

Please sign in to comment.