If you try to run a locpick change, but no original marker exists then the operation fails. Additionally there is no API method for testing if it exists, and no alternative method to create the first marker.
Additionally there is a flaw that if the original locpick_invalid is set to true, and a location is set, the system still thinks it is invalid.
The only inline solution is to duplicate the marker creation in the 'init' handler, and manually attach it to the obj. If we could extract that marker generation, and maybe put it in locpickchange, with a validation there, then things would be tested at the appropriate time, and external elements could safely trigger locpickchange.
I have a patch to submit.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | gmap-locpickrefactor-1980340-6.patch | 5.54 KB | jaxxed |
| #1 | gmap-lockpickmarkergenerationinlockpickchange-1980340-1.patch | 3.33 KB | jaxxed |
Comments
Comment #1
jaxxed commentedHere is a patch that:
- moves marker generation to the locpickchange event
- init uses lockpickchange
- locpick_invalid checked on locpickchange
- allow parameter position to lockpickchange (you can still manuallly set locpick_coord)
Comment #2
jaxxed commentedComment #3
podarokall feature requests should be rolled against latest dev and after commit backported to previous version
Comment #4
jaxxed commented#1: gmap-lockpickmarkergenerationinlockpickchange-1980340-1.patch queued for re-testing.
I think that the D7 and D6 lockpick JS are the same, so I will try to rerun the test.
Comment #6
jaxxed commentedrecreated patch from 7.x-2.x branch.
I simplified my approach a little bit to remove some unnecessary changes I'd made.
Comment #7
podarok#6 commited pushed to 7.x-2.x
Thanks!!!!!