This repository has been archived by the owner on Jul 6, 2024. It is now read-only.
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.
Hi,
I've updated references throughout the code and the README, to point to the 2017 version of the congressional boundaries file.
I also updated example/index.html; you will want to switch the public key and username back to your own, but the main change I made was to include the five district_n_label layers in the call to map.queryRenderedFeatures at line 281. The title_long property was only present in those, and I wasn't otherwise able to get it to display as anything other than 'undefined' when clicking on a district.
It's an imperfect solution... The title only displays in the alert when you click on the label, but is still undefined when you click on any other part of a district.
I've learned a lot about mapbox by working through your instructions. I'm still futzing around with the layers to figure out how to get the data to display when clicking anywhere on the district. I'd love to know if you have a better solution for this.
Thanks,
Chris