I have a block with a google_maps map and it was all working fine until I try to use a sprite as icon. I know how to use sprites as I already used them in others pages of my site.

I think the problem here is that the block can't access the sprite image and I don't know where are my blocks or where is the default location of the Drupal 8 blocks folder.

By the way, I don't know if it helps but here is part of the code:

<meta name="viewport" content="initial-scale=1.0, user-scalable=no"><meta charset="utf-8">
  #map {
    height: 500px;
    width: 100%;

<div id="map">&nbsp;</div>
<img id="mapIcon" src="/images/spt.png" alt="Map icon" style="width: 200px; height: 200px;">

      function initMap() {
         var mapIcon = document.getElementById("mapIcon").src;
         var markers = locations.map(function(location, i) {
            return new google.maps.Marker({
               position: location;
               map: map;
               icon: mapIcon;

Already used the




but none of them worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.