-
Notifications
You must be signed in to change notification settings - Fork 86
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
Highlight mouseover elements (WIP) #75
base: master
Are you sure you want to change the base?
Conversation
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 looks fantastic, just a little cleanup.
delete map["highlightPoints"]; | ||
} | ||
|
||
map["highlightPoints"] = L.glify.points({ |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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 Lines
instead ofL.glify.lines
fixes 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.