toing_toing
toing_toing

Reputation: 2442

Remove box shadow from custom marker in google maps

I have made a custom marker for a website I am developing. It works, except that the marker, which needs to be circular, shows a box shadow around it. I need to remove the box shadow. Here's a screenshot:

enter image description here How do I remove these shadows and leave only the circular part of the marker visible? Here's my code for the marker (which is loaded from a for loop because there are multiple markers):

for (i = 0; i < locations.length; i++) { 

        //string temp = builder.concat(i.toString());
      marker = new RichMarker({
        position: new google.maps.LatLng(locations[i]['lat'], locations[i]['lng']),
        map: map,
        content: '<img width="40" height="40" class="circ map-thumbnail" src="./img/testpic.jpg"/>',
        animation: google.maps.Animation.DROP
      });

      google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
          infowindow.setContent(locations[i]['name']);
          infowindow.open(map, marker);
        }
      })(marker, i));


google.maps.event.addListener(marker, 'mouseover', function(event) {
    this.setZIndex(10);
});

google.maps.event.addListener(marker, 'mouseout', function(event) {
    this.setZIndex(0);
});



    }

Here's the css:

      img.map-thumbnail {
    cursor: pointer;
    border: 2px solid #ffffff;
}

.circ {
  border-radius:99px;
 -moz-border-radius:99px;
 -webkit-border-radius:99px;
  background:red;
  color:#fff;
  border:3px #fff solid;
  background-color: #e7676d;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#e7676d), to(#b7070a)); /* Saf4+, Chrome */
  background-image: -webkit-linear-gradient(top, #e7676d, #b7070a); /* Chrome 10+, Saf5.1+, iOS 5+ */
  background-image: -moz-linear-gradient(top, #e7676d, #b7070a); /* FF3.6 */
  background-image: -ms-linear-gradient(top, #e7676d, #b7070a); /* IE10 */
  background-image: -o-linear-gradient(top, #e7676d, #b7070a); /* Opera 11.10+ */
  background-image: linear-gradient(top, #e7676d, #b7070a);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#e7676d', EndColorStr='#b7070a'); 
 -webkit-box-shadow: none; /* Saf3-4 */
 -moz-box-shadow: none; /* FF3.5 - 3.6 */
  box-shadow: none; /* Opera 10.5, IE9, FF4+, Chrome 10+ */
  display:inline-block;
  padding:2px 2px 2px 2px ;
  margin:3px;
  font-family:arial;
  font-weight:bold;
   }

Upvotes: 0

Views: 2219

Answers (1)

Viktor Sarstr&#246;m
Viktor Sarstr&#246;m

Reputation: 510

Add shadow: 'none' to your RichMarker.

marker = new RichMarker({
    position: new google.maps.LatLng(locations[i]['lat'], locations[i]['lng']),
    map: map,
    content: '<img width="40" height="40" class="circ" src="./img/testpic.jpg"/>',
    animation: google.maps.Animation.DROP,
    shadow: 'none'
});

Upvotes: 4

Related Questions