Closed azusa5526 closed 1 year ago
OK I can see what's happening here and it's a bug. Markers are not like all the other shapes in that they can be dragged but not edited.
I am currently rewriting the whole Drawing Manager to be more of a wrapper for the Google component, because the current approach mutates the props passed in and alternatives are too hard to manage. This means the Drawing Manager will only be used for creating new shapes, and the responsibility for managing editing existing shapes will be up to the parent component.
I would encourage you to have a look at the implementation of the Drawing Manager and use the code to add your own editing of the shapes. Use the click event to select a shape and set edit and drag to true (except for Markers - just set drag), and then watch for events on the shape.
I am currently checking each shape because I think they also mutate their props and will need to be fixed, so watch for editing side effects
Thanks for your reply. Due to the lack of time, I copy the Drawing Manager source from node_modules into my project and added the if statement directly to 'setSelection(shape)' & 'clearSelection()' in order to avoid markers calling the 'setEditable' function. Let me thank you one more time for replying to my message.
Best Regards, Andrew (azusa5526)
Related to #265
I will leave the issue on stand by
until @davydnorris finish the PR for the mentioned feature above.
Use the workaround as you have done already until I fix all the shapes - but I'll fix it in an update for all shapes as there are some issues with them all
Migrate to the new version of the plugin for Vue v3
Describe the bug
Add marker by GmapDrawingManager will get fail message "shape.overlay.setEditable is not a function". In this time click the map or draw another shape will get fail message "this.selectedShape.overlay.setEditable is not a function"
To reproduce
Steps to reproduce the behavior:
Expected behavior
After marker added, select shape & create with no error.
Current behavior
When add marker by GmapDrawingManager. The select function will be broken and give the fail messages.
Screenshots
Desktop (please complete the following information)
Smartphone (please complete the following information)
Additional context
Create all type of shapes will calling the function ''setSelection". And I think maybe marker is not support 'editable' in google map javascript api but the other shapes like polygon, polyline support it. So, only create marker will trigger this error.
Versions
Package manager
Plugin version