如何褪色Yandex地图,但留下地理色?

时间:2016-03-21 17:44:58

标签: javascript css3 yandex-maps

如何让它跨浏览器? 下面引用示例代码,尝试旧地图Yandex,选择此选项按钮:.ymaps-layers-pane - 有效,但没有2.1。希望使它跨浏览器,在IE中不起作用

div#map {
  filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
  /* Firefox 3.5+ */
  -webkit-filter: grayscale(100%);
  /* Chrome 19+ & Safari 6+ */
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
  -moz-filter: grayscale(100%);
  -ms-filter: grayscale(100%);
  -o-filter: grayscale(100%);
  filter: url(desaturate.svg#greyscale);
  filter: gray;
}
<script src="http://a159152.mcdir.ru//sites/all/themes/COSMO/2.1.js"></script>
<div id="map" style="width: 100%; height: 700px"></div>
<script type="text/javascript">
  ymaps.ready(init);
  var myMap;

  function init() {
    myMap = new ymaps.Map("map", {
      center: [51.767481084662506, 55.113224784597655],
      zoom: 16
    });

    var myPlacemark = new ymaps.Placemark([51.767481084662506, 55.113224784597655], {}, {
      iconLayout: 'default#image',
      iconImageHref: 'http://a159152.mcdir.ru//sites/all/themes/COSMO/images/icon_location_2.png',
      iconImageSize: [158, 176],
      iconImageOffset: [-69, -277]
    });
    myMap.geoObjects.add(myPlacemark);
  }
</script>

0 个答案:

没有答案