Skip to content

plugin-map README teaches an API the package does not implement — every snippet in it renders an empty map #5002

Description

@yinlianghui

Found while implementing #4941. Filed unassigned, not claiming.

packages/plugin-map/README.md documents a schema and an export that do not exist in the package. A reader who copies any of its snippets gets an empty map with no diagnostic.

What the README teaches vs what the code reads

README Reality (packages/plugin-map/src/)
center: { lat, lng } (object) center is read as a [lat, lng] tuple (MapConfigSchema = z.tuple); the object form fails validation, is warned about, and is ignored
markers: [{ lat, lng, label }] never read — markers come from the queried records via latitudeField / longitudeField / locationField
layers?: MapLayer[] never read; no layer support exists
height?: number | string never read; the container height is fixed Tailwind classes
onMarkerClick in the schema it is a React prop of ObjectMap, not a schema key
import { mapComponents } from '@object-ui/plugin-map' + manual Object.entries(...) registration no such export: index.tsx exports ObjectMap / ObjectMapRenderer and self-registers object-map / map
zoom?: number // Default: 10 there is no default zoom any more (PR #5000 — the camera fits the records unless one is declared)

Nothing in the README mentions the keys that actually drive the component (objectName, data, map: { latitudeField, longitudeField, locationField, titleField, descriptionField }).

The accurate document is content/docs/plugins/plugin-map.mdx, which matches the code (and was updated by PR #5000). The README looks like it predates the ObjectQL-driven component and was never reconciled.

Suggested shape of the fix

Rewrite packages/plugin-map/README.md against the code, or reduce it to a pointer at the docs page plus the real ObjectMap props. Worth checking the sibling plugin-* READMEs in the same pass — this one is unlikely to be alone.

Note for whoever picks it up: content/docs/** is gated (check-doc-component-types), package READMEs are not, which is plausibly why the drift survived.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationpm:dispatched

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions