docs: show a working example of updating sidebar content dynamically - #95
Open
MikeGatsby wants to merge 1 commit into
Open
docs: show a working example of updating sidebar content dynamically#95MikeGatsby wants to merge 1 commit into
MikeGatsby wants to merge 1 commit into
Conversation
The setContent() snippet was a single static call with no example of
using it in response to a map event, which is the actual use case
readers were asking about. Replace it with a real map.on('move', ...)
handler and point to the listing-markers example, which already does
exactly this, as a full working demo.
Closes Turbo87#76
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.
What this PR does
#76 asked for a working example of setting sidebar content dynamically —
one already exists (
examples/listing-markers.html, already linked fromthe Examples section) but the README's own Usage section only showed
setContent()called once with a static string, not tied to any event, soit didn't answer the actual question a reader would have.
Replaces the static snippet with a real
map.on('move', ...)handler(matching what
listing-markers.htmlactually does) and links directly tothat example and its source, right where
setContent()is introduced.Closes #76
Testing
No test/lint command in this repo covers Markdown (
npm testrunsgulp lintagainst JS/CSS source only). Self-reviewed for accuracy: themap.on('move', ...)→setContent()pattern shown is copied from thereal, working code in
examples/listing-markers.html, not invented.