Clickable point features, fires featureclick event#71
Open
nickw1 wants to merge 1 commit intokothic:masterfrom
Open
Clickable point features, fires featureclick event#71nickw1 wants to merge 1 commit intokothic:masterfrom
nickw1 wants to merge 1 commit intokothic:masterfrom
Conversation
Komzpa
reviewed
May 1, 2020
|
|
||
| var lowest = Number.MAX_VALUE, nearestFeature = null; | ||
| for(var i = 0; i < this._data[key].features.length; i++) { | ||
| var dx = Math.abs(this._data[key].features[i].coordinates[0] - dataX), dy = Math.abs(this._data[key].features[i].coordinates[1] - dataY); |
Member
There was a problem hiding this comment.
It looks like this one will not work on polygons? I don't see a safeguard on that.
Komzpa
reviewed
May 1, 2020
| this._data[key].features = []; | ||
| for(var i = 0; i < data.features.length; i++) { | ||
| if(data.features[i].type == "Point") { | ||
| this._data[key].features.push(data.features[i]); |
Member
There was a problem hiding this comment.
Oh, sorry, now I see the safeguard.
Will it make sense to also append the reprpoint of polygons to make them clickable too? Shouldn't be a huge investment but will help.
Collaborator
Author
There was a problem hiding this comment.
@Komzpa yes good point, shouldn't be too difficult. Thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clickable Kothic layer; recreating PR #66 from three years ago which I have closed.
Decided to do a clean fork and create a single commit as the previous one had become messy.