Skip to content

docs: show a working example of updating sidebar content dynamically - #95

Open
MikeGatsby wants to merge 1 commit into
Turbo87:masterfrom
MikeGatsby:docs/issue-76-dynamic-content-example
Open

docs: show a working example of updating sidebar content dynamically#95
MikeGatsby wants to merge 1 commit into
Turbo87:masterfrom
MikeGatsby:docs/issue-76-dynamic-content-example

Conversation

@MikeGatsby

Copy link
Copy Markdown

What this PR does

#76 asked for a working example of setting sidebar content dynamically —
one already exists (examples/listing-markers.html, already linked from
the Examples section) but the README's own Usage section only showed
setContent() called once with a static string, not tied to any event, so
it 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.html actually does) and links directly to
that example and its source, right where setContent() is introduced.

Closes #76

Testing

No test/lint command in this repo covers Markdown (npm test runs
gulp lint against JS/CSS source only). Self-reviewed for accuracy: the
map.on('move', ...)setContent() pattern shown is copied from the
real, working code in examples/listing-markers.html, not invented.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve readme

1 participant