0

Normally, the location list is shown on the right side like this:

lightning map with location list

That is until you have a lot of markers - around 100 in my case. The map looks awful with many markers but users noticed that it looks pretty decent if you don't have the full width which leads to the location list being displayed below the map.

Can I force this behavior to always show the list below the map?

1
  • 3
    Guys - why are you downvoting this question? If it is really that bad - please help me improve it!
    – Semmel
    Commented Mar 23 at 8:58

1 Answer 1

0

For forcing the map to show markers below , we need to limit the width of the map component as below :

Markup:

<div class="map-container">
    <lightning-map
      map-markers={mapMarkers}
      markers-title="Lunch Gems"
      onmarkerselect={handleMarkerSelect}
      selected-marker-value={selectedMarkerValue}
  >
  </lightning-map>
  </div>

CSS:

.map-container {
  width: 37vw;
}

Note : I've used vw for specifying width. You can change it for handling different screen sizes using either device sizes or media query

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .