Highlight mouseover elements (WIP)#75
Conversation
robertleeplummerjr
left a comment
There was a problem hiding this comment.
This looks fantastic, just a little cleanup.
| delete map["highlightPoints"]; | ||
| } | ||
|
|
||
| map["highlightPoints"] = L.glify.points({ |
There was a problem hiding this comment.
Can you just use points here, otherwise the implementer cannot overload leaflet, which is a need in some cases.
There was a problem hiding this comment.
Also, can we use a different means of saving the instance of the points on the highlighted map? Otherwise, we're modifying something we don't own. My suggestion would be potentially to store it as a static value within the points class.
There was a problem hiding this comment.
I could only use glify.points when exporting glify from index.ts and using import { glify } from './index'; in points.ts.
I managed to store the highlighted points in instance.settings.highlightedPoints, but after some heavy hovering I am getting the following errors:
Exceeded 300 live WebGL contexts for this principal, losing the least recently used one. glify-browser.js:12:656
WebGL context was lost. glify-browser.js:12:656
and sometimes this one:
Uncaught TypeError: t is null
_redraw glify-browser.js:10:2040
Everything seems to still work fine in Firefox, but Chrome removes all layers from the map as soon as the WebGL error occurs. Do you have any suggestions?
There was a problem hiding this comment.
It seems new instances of webgl are being created? Perhaps caching them and reusing them would fix this?
| var data = Object.assign({"type":"FeatureCollection", | ||
| "features": [feature]}); | ||
|
|
||
| map["highlightPolygon"] = L.glify.shapes({ |
There was a problem hiding this comment.
Same idea here with using shapes, we should be able to use this more directly.
|
Conflicts. |
|
Can you look at these conflicts when you get a chance? |
|
Part of this just went into master. Still looking to add highlight. |
|
The Leaflet's My fix #179 solved that issue with hovering the line features without |
This is a follow-up from #53 and includes #74 .
Although everything seems to work fine, I am seeing Problems in Visual Studio:
I also had to include
import L from 'leaflet';for lines/shapes/points, as otherwise I would have had 3 additional problems.I am not sure why this happens or how it is done correctly. I tried different approaches without success.
Using
new Linesinstead ofL.glify.linesfixes the problem in VS but it doesn't work and throws several webGL warnings and an error in the console:I hope someone can shed some light on these problems.