# Multiple Markers On Map

**URL:** <https://forum.bootstrapstudio.io/t/multiple-markers-on-map/12810>\
**Category:** Bootstrap Studio Help\
**Created:** [October 20, 2026, 2:23am UTC](https://forum.bootstrapstudio.io/t/multiple-markers-on-map/12810 "2026-10-20T02:23:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheodorShep](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TheodorShep](https://forum.bootstrapstudio.io/u/TheodorShep)\
**Post date:** [October 20, 2026, 2:23am UTC](https://forum.bootstrapstudio.io/t/multiple-markers-on-map/12810/1 "2026-10-20T02:23:43Z")

</div>

Hi there, using the google maps component, how am i able to add multiple markers rather than just one address?

Thank you.

---

<div class="post-metadata">

**Author:** ![TheodorShep](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TheodorShep](https://forum.bootstrapstudio.io/u/TheodorShep)\
**Post date:** [October 20, 2026, 7:08pm UTC](https://forum.bootstrapstudio.io/t/multiple-markers-on-map/12810/2 "2026-10-20T19:08:55Z")

</div>

So far I’ve got this code:

```auto
<html>
    <head>
        <title>Add a Map with Markers using HTML</title>
        <style>
            gmp-map {
                height: 100%;
            }
            html,
            body {
                height: 100%;
                margin: 0;
                padding: 0;
            }
        </style>
        <script type="module" src="./index.js"></script>
        <script
            async
            src="https://maps.googleapis.com/maps/api/js?loading=async&key= ****** 2TV3sAd-QwS_bu_yvhJjQhga1fA&libraries=maps,marker"></script>
    </head>
    <body>
        <gmp-map
            center="51.54609979351465, 11.602242228912166"
            zoom="2"
            map-id="DEMO_MAP_ID">
            <gmp-advanced-marker
                position="53.48059463593195, -2.2389147610283655"
                title="Manchester, UK"></gmp-advanced-marker>
            <gmp-advanced-marker
                position="51.512717839210254, -0.10435506996064603"
                title="London, UK"></gmp-advanced-marker>                
        </gmp-map>
    </body>
</html>

```

However I’m not sure how to add this into BSS to display on the website.

I’ve tried adding the contents of body into a custom code component and the head in the page’s head options, and alternatively both in the same code block but it’s not rendering on the website. Any help on how to add this code into the design?

---

<div class="post-metadata">

**Author:** ![printninja](https://forum.bootstrapstudio.io/user_avatar/forum.bootstrapstudio.io/printninja/32/481_2.png) [@printninja](https://forum.bootstrapstudio.io/u/printninja)\
**Post date:** [October 20, 2026, 9:20pm UTC](https://forum.bootstrapstudio.io/t/multiple-markers-on-map/12810/3 "2026-10-20T21:20:24Z")

</div>

According to Google’s AI, Gemini…

Embedding a Google Map with multiple markers is very common, and you can achieve it in one of two ways depending on your technical comfort level: **the easy way (no coding required)** using Google My Maps, or **the developer way** using the Google Maps JavaScript API.

### Method 1: The Easy Way (Google My Maps)

_Best for: Non-developers, small businesses, event pages, or anyone wanting a quick visual setup without writing code._

1. **Create your map:**

2. **Add your markers:**

3. **Make the map public:**

4. **Get the embed code:**

5. **Paste into your website:**

### Method 2: The Developer Way (Google Maps JavaScript API)

_Best for: Custom web apps, dynamic data pulling from a database, or when you need complete control over styling and interactivity._

1. **Get an API Key:**

2. **Add the HTML container and script:**

Here is a clean, modern code example using an array of locations:

HTML

```auto
<!DOCTYPE html>
<html>
  <head>
    <title>Multiple Markers Map</title>
    <style>
      #map {
        height: 500px;
        width: 100%;
      }
    </style>
  </head>
  <body>

    <h3>Our Locations</h3>
    <div id="map"></div>

    <!-- Load the Google Maps JavaScript API -->
    <script>
      async function initMap() {
        // Request needed libraries
        const { Map } = await google.maps.importLibrary("maps");
        const { AdvancedMarkerElement } = await google.maps.importLibrary("marker");

        // Center the map (e.g., New York City)
        const map = new Map(document.getElementById("map"), {
          zoom: 12,
          center: { lat: 40.7128, lng: -74.0060 },
          mapId: "YOUR_MAP_ID_HERE", // Optional, required for Advanced Markers styling
        });

        // Define your array of locations
        const locations = [
          { lat: 40.7128, lng: -74.0060, title: "Location A" },
          { lat: 40.7306, lng: -73.9352, title: "Location B" },
          { lat: 40.6782, lng: -73.9442, title: "Location C" }
        ];

        // Loop through locations and add markers
        locations.forEach(loc => {
          const marker = new AdvancedMarkerElement({
            map: map,
            position: { lat: loc.lat, lng: loc.lng },
            title: loc.title,
          });
        });
      }

      initMap();
    </script>

    <!-- Replace YOUR_API_KEY with your actual Google Maps API key -->
    <script async src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>
  </body>
</html>

```

> **Tip:** If you just want a standard map without custom map IDs, you can use the traditional `google.maps.Marker` instead of `AdvancedMarkerElement`, though Google encourages migrating to the newer advanced markers for future compatibility.

### Which one should you choose?

- Choose **Method 1 (My Maps)** if you just want to copy-paste an iframe in 5 minutes.

- Choose **Method 2 (API)** if your locations change dynamically based on user input or a database backend.

---

<div class="post-metadata">

**Author:** ![TheodorShep](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TheodorShep](https://forum.bootstrapstudio.io/u/TheodorShep)\
**Post date:** [October 21, 2026, 1:55pm UTC](https://forum.bootstrapstudio.io/t/multiple-markers-on-map/12810/4 "2026-10-21T13:55:24Z")

</div>

I managed to get this working eventually by myself. Although, not sure what i did to make it work haha.
