Skip to main content

Map

Use Map to display a map on a page. This component is useful for displaying a map of a location, such as a store or a customer’s address.

Support
Targets (24)

Supported targets

  • customer-account.footer.render-after
  • customer-account.order-index.announcement.render
  • customer-account.order-index.block.render
  • customer-account.order-status.announcement.render
  • customer-account.order-status.block.render
  • customer-account.order-status.cart-line-item.render-after
  • customer-account.order-status.cart-line-list.render-after
  • customer-account.order-status.customer-information.render-after
  • customer-account.order-status.fulfillment-details.render-after
  • customer-account.order-status.payment-details.render-after
  • customer-account.order-status.return-details.render-after
  • customer-account.order-status.unfulfilled-items.render-after
  • customer-account.order.action.menu-item.render
  • customer-account.order.action.render
  • customer-account.order.page.render
  • customer-account.page.render
  • customer-account.profile.addresses.render-after
  • customer-account.profile.announcement.render
  • customer-account.profile.block.render
  • customer-account.profile.company-details.render-after
  • customer-account.profile.company-location-addresses.render-after
  • customer-account.profile.company-location-payment.render-after
  • customer-account.profile.company-location-staff.render-after
  • customer-account.profile.payment.render-after

Anchor to accessibilityLabel
accessibilityLabel
string

A label that describes the purpose or contents of the map.

When set, it will be announced to users using assistive technologies and will provide them with more context.

Anchor to apiKey
apiKey
string

A valid API key for the map service provider.

The map service provider may require an API key. Without an API key the map could be hidden or render in a limited developer mode.

Anchor to blockSize
blockSize
<>
Default: 'auto'

Adjust the block size.

string

A unique identifier for the element.

Anchor to inlineSize
inlineSize
<>
Default: 'auto'

Adjust the inline size.

Anchor to latitude
latitude
number
Default: 0

Map center’s latitude in degrees.

Anchor to longitude
longitude
number
Default: 0

Map center’s longitude in degrees.

Anchor to maxBlockSize
maxBlockSize
<>
Default: 'none'

Adjust the maximum block size.

Anchor to maxInlineSize
maxInlineSize
<>
Default: 'none'

Adjust the maximum inline size.

Anchor to maxZoom
maxZoom
number
Default: 18

The maximum zoom level which will be displayed on the map.

Valid zoom values are numbers from zero up to 18.

Anchor to minBlockSize
minBlockSize
<>
Default: '0'

Adjust the minimum block size.

Anchor to minInlineSize
minInlineSize
<>
Default: '0'

Adjust the minimum inline size.

Anchor to minZoom
minZoom
number
Default: 0

The minimum zoom level which will be displayed on the map.

Valid zoom values are numbers from zero up to 18.

number
Default: 4

The initial Map zoom level.

Valid zoom values are numbers from zero up to 18. Larger zoom values correspond to a higher resolution.

Learn more about registering events.

Anchor to boundschange
boundschange
<typeof tagName, >

Callback when the viewport bounds have changed or the map is resized.

Anchor to click
click
<typeof tagName, >

Callback when the user clicks on the map.

Anchor to dblclick
dblclick
<typeof tagName, >

Callback when the user double-clicks on the map.

Anchor to viewchange
viewchange
<typeof tagName, >

Callback when the map view changes.

Use MapMarker to display a marker on a map. Use only as a child of s-map component.

Anchor to accessibilityLabel
accessibilityLabel
string

A label that describes the purpose of the marker. When set, it will be announced to users using assistive technologies and will provide them with more context.

Anchor to blockSize
blockSize
<>
Default: 'auto'

Adjust the block size.

Anchor to clusterable
clusterable
boolean
Default: false

Allows grouping the marker in clusters when zoomed out.

Anchor to command
command
'--auto' | '--show' | '--hide' | '--toggle'
Default: '--auto'

Sets the action the commandFor should take when this clickable is activated.

See the documentation of particular components for the actions they support.

  • --auto: a default action for the target component.
  • --show: shows the target component.
  • --hide: hides the target component.
  • --toggle: toggles the target component.
  • --copy: copies the target ClipboardItem.
Anchor to commandFor
commandFor
string

ID of a component that should respond to activations (e.g. clicks) on this component.

See command for how to control the behavior of the target.

Anchor to inlineSize
inlineSize
<>
Default: 'auto'

Adjust the inline size.

Anchor to latitude
latitude
number
Default: 0

Marker’s location latitude in degrees.

Anchor to longitude
longitude
number
Default: 0

Marker’s longitude latitude in degrees.

Learn more about registering events.

Anchor to click
click
<typeof tagName>

Callback when a marker is clicked.

It does not trigger a click event on the map itself.

Learn more about component slots.

Anchor to graphic
graphic
HTMLElement

The graphic to use as the marker.

If unset, it will default to the provider’s default marker.

Examples
<s-map apiKey="YOUR_API_KEY" latitude={51.5074} longitude={-0.1278}>
<s-map-marker latitude={51.5074} longitude={-0.1278}></s-map-marker>
</s-map>

Preview

Was this page helpful?