Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have some problems with the highlight JS code.
1. sometimes marker highlights don't disappear
2. highlight code is split across marker and highlight JS
3. highlight functions and var are global scope.
I have a patch
This is obviously a low priority, but it may fix some of the other issues reported RE highlights sticking.
Comment | File | Size | Author |
---|---|---|---|
#15 | gmap_1982292_15_highlightrefactor.patch | 14.5 KB | johnv |
#13 | gmap-highlightrefactor-1982292-13.patch | 12.75 KB | jaxxed |
#5 | gmap-highlightrefactor-1982292-5.patch | 12.26 KB | jaxxed |
#1 | gmaps-highlightrefactor-707484-1.patch | 10.87 KB | jaxxed |
Comments
Comment #1
jaxxed CreditAttribution: jaxxed commentedHere is my refactor patch.
It takes the same base approach of using an overlay to keep a sized object, but switches to a circle (instead of rpolygon) and moves a lot of the event code into this highlight JS file.
- marker events/binds for 'markerHighlight' and 'markerUnHighlight' are used.
- highlight and unhighlight functions are now at Drupal.gmaps. and are avaiable outside of markers.
Tested and currently in use.
(This is another patch that could work for D7 modules as well)
RISK: if the highlightMarker and unhighlightMarker global functions are used in other locations they will fail (global function are out of style.) consider moving to an obj.change instead.
Comment #2
jaxxed CreditAttribution: jaxxed commentedComment #3
podarokall feature requests should be rolled against latest dev and after commit backported to previous version
Comment #4
jaxxed CreditAttribution: jaxxed commentedI can type
Comment #5
jaxxed CreditAttribution: jaxxed commentednew patch, properly done with the 7.x-2.x git source.
Comment #6
podarok#5 commited pushed to 7.x-2.x
Thanks!!!!
Comment #7
podaroktagged new beta release http://drupal.org/node/1987146
Comment #8
jaxxed CreditAttribution: jaxxed commentedjust a heads up. I did some stress testing and found some cases where the highlight doesn't deactivate. I'll work on it more.
Comment #9
podaroklooking forward for possible follow-ups about to #8
Comment #10
jaxxed CreditAttribution: jaxxed commentedRE: #9 : I have a change that I am looking at that solve this, but I am trying to figure out how to allow highlights for mouseovers to be separate use cases from mouseover highlights. For now I will just try to fix the problem, and worry about the additional use-cases in the future.
Comment #11
jaxxed CreditAttribution: jaxxed commentedjust an update. I am still working on this, but had to change plans when I discovered that overlay draws happen again on zoom events.
Comment #12
podaroklooks like task
possible better title needed
or if this some kind of different task - good to create follow-up issue for minimising comment counter and better summary update
Comment #13
jaxxed CreditAttribution: jaxxed commentedHere is a completed refactor:
-fixes orphaned highlights,
-fixes zoom problems (highlights re-appear or are wrong size)
-uses a single overlay for all highlights, instead of one overlay for each highlight (no need with the v3 library as the overlay is only really used to translate pixels into meters.)
Stress tested here: http://drupal.12thirty4.com/gmaps/gmaptest/shapes
Comment #15
johnvI reported #2030397: No markers when 'Aggregate JavaScript files.' in IE8 ( due to error 'ID is expected' in highlight.js ? ) , and tried this patch to see if it resolved the problem. It doesn't :-( (the js-error and the vanishing of the markers still happen)
Otherwise, the patch does not break my site (but I only show markers, not sure what the function of highlight is.)
I couldn't apply the patch to latest dev version, mainly/only due to indentation differences. So here's a new version.
Comment #16
podaroksomeone needs review this by hands with proper screenshots uploaded
Comment #17
podarok#15 commited pushed to 7.x-2.x
Thanks!