-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show other markers on the map in the edit mode #581
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not quite work, if you move editing pin out of screen by dragging the map and then drag it back, the point will be re-added, also this is not ideal to loop over all points every time we editing to find the right point (as pointed earlier). I suggest to refactor this in a way that
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I'll see thanks for your feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (пока что отдыхаю) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @circus2271, are you planning to complete this at any time soon? If not I can take it over and finish (if you don't mind). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I don't mind at all (I was too lazy to complete it) |
||
} | ||
|
||
this.pointHighlightDestroy().pointEditCreate(); | ||
} else { | ||
this.pointEditDestroy().pointHighlightCreate().markerManager.enable(); | ||
this.markerManager.disable(); | ||
this.pointEditDestroy().pointHighlightCreate(); | ||
this.markerManager.enable(); | ||
} | ||
}, | ||
// Включает режим редактирования | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest instead of looping over markers and disabling event, use
this.editing
flag (in map controller) in thepopupPhotoOver
andclickMarker
event processing functions in themarker.js
(in those functions do not do anything if editing mode is on).