How to remove the original markers in GoogleMaps

I want to remove the icon display from the map. Styling via the GoogleMaps Wizard is not suitable, since the map is not static. The google maps api has a solution through map styling, which was implemented, but it does not work. What can you advise, maybe there are some errors in the code or you need to rewrite it in a different way?

These icons are icons

What is in the code now - code

Author: jkorichneva, 2017-06-14

1 answers

What you want to remove is called the business layer I cleaned like this

 var customMapType = new google.maps.StyledMapType([
        {
            featureType: "poi.business",
            stylers: [
              {
                  visibility: "off"
              }
            ]
        }
    ], {
        name: 'Custom Style'
    });
    var customMapTypeId = 'custom_style';

    var mapOptions = {
        zoom: 15,
        center: location,
        mapTypeControl: false,
        mapTypeControlOptions: {
            mapTypeIds: [google.maps.MapTypeId.ROADMAP, customMapTypeId]
        }
    }

    var map = new google.maps.Map(element, mapOptions);
    map.mapTypes.set(customMapTypeId, customMapType);
    map.setMapTypeId(customMapTypeId);

Element-the actual element that is being bound to

 0
Author: sirishotka, 2017-06-14 16:02:56