Skip to content

fix: provide absolute URL comments for graphic assets for copy-paste - #1733

Closed
willum070 wants to merge 1 commit into
mainfrom
graphic-path-update
Closed

willum070 wants to merge 1 commit into
mainfrom
graphic-path-update

Conversation

@willum070

Copy link
Copy Markdown
Collaborator

This PR resolves an issue where developers copying code snippets from the advanced-markers-graphics and 3d-marker-graphics samples would encounter broken images because the local relative assets (./public/... or images/...) are not present in their local environments or JSFiddle.

Changes:

  • Added clear, educational comments above image instantiations providing the absolute hosted URL (https://maps-docs-team.web.app/...) for the required assets (beachflag.png, google_logo_g.svg, and 192px.svg).
  • Retained the import.meta.url Vite pattern for the actual execution lines.

Why this approach?
This pattern provides the best of both worlds:

  1. Fixes copy-paste: Documentation readers are explicitly given the absolute URL they need to make the snippet work immediately in their own projects.
  2. Preserves local development: Local Vite development (npm start) continues to resolve the local assets seamlessly, avoiding the "chicken-and-egg" issue of requiring an asset to be deployed to production before it can be previewed locally.
  3. Self-contained repository: Ensures the project structure remains self-contained with its own graphic assets.

Affected Samples

  • advanced-markers-graphics
  • 3d-marker-graphics

Testing

  • Verified that local Vite builds and npm start continue to work flawlessly.
  • Verified standard Prettier and ESLint rules pass.

Fixes b/499325122

Change-Id: I495fc4a4ef5a6563806250567396e6b28f5a7f14

…-paste bug

Change-Id: I495fc4a4ef5a6563806250567396e6b28f5a7f14
@willum070
willum070 requested a review from chrisjshull October 16, 2026 16:58
@willum070 willum070 closed this Oct 16, 2026
@willum070
willum070 deleted the graphic-path-update branch October 16, 2026 18:12
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.

1 participant