0

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">
<title></title>
<style>
  #map {
    height: 500px;
    width: 100%;
  }
</style>

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

      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;
            });         
         });
</script>

Already used the

src="/images/spt.png"

and

src="/home/rui/public_html/themes/custom/drupal_zymphonies_theme/images"`

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.