-
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?
Show other markers on the map in the edit mode #581
Conversation
bac84b2
to
03633f4
Compare
Thanks @circus2271, this needs to be improved:
|
@kabalin take a look at 'another draft' commit, please. Is it terribly wrong? |
7dd656d
to
5090950
Compare
8cb88f0
to
33c10df
Compare
33c10df
to
a245233
Compare
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.
Thanks for your work @circus2271, see the comments.
public/js/module/map/map.js
Outdated
this.pointHighlightDestroy().pointEditCreate().markerManager.disable(); | ||
let highlightedPhotoLayer; | ||
|
||
this.markerManager.layerPhotos.eachLayer(function (marker) { |
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 the popupPhotoOver
and clickMarker
event processing functions in the marker.js
(in those functions do not do anything if editing mode is on).
public/js/module/map/map.js
Outdated
}); | ||
|
||
if (highlightedPhotoLayer) { | ||
this.markerManager.layerPhotos.removeLayer(highlightedPhotoLayer); |
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.
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 cid
would be used to identify the point. To do this:
- Keep
cid
of editing point in map controller object. - When editing mode is on, identify current point using
photos[cid].marker
(markers module) and remove it from layer group (this.markerManager.layerPhotos.removeLayer
). - When new markers are added as result of panning/zooming map and editing is on, check if newly added point is matching editing
cid
, if so, do not add it to the layer group. - When editing mode is off, add a new point marker only to the layer group, no need to refresh all.
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.
ok, I'll see
thanks for your feedback
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.
(пока что отдыхаю)
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't mind at all
That would be great, thanks
(I was too lazy to complete it)
#482