地图是自动生成的,地图标记是自动生成的.在HTML代码中,生成的地图标记如下所示:
<image id="Geometry_Point" cx="250.63056092843334"
cy="233.0863010581852" r="1" preserveAspectRatio="none" x="235" y="196"
width="32" height="37" xlink:href="http://icons.iconarchive.com/icons
/paomedia/small-n-flat/24/map-marker-icon.png" style="opacity: 1"
fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">其中标记图标图片与链接(如xlink:href="link" )一起提供
是否有可能用新的标记链接用CSS来覆盖它呢?
发布于 2016-12-02 06:58:24
CSS不能更改元素的属性,请使用js。CSS只用于视觉效果。
document.getElementById('Geometry_Point').setAttribute('xlink:href', 'http://google.com')只需确保没有JS已经接受该值并使用它进行缓存。
发布于 2016-12-02 07:30:37
使用::after css伪选择器在图层上设置图标,如: css:
#Geometry_Point::after {
content: '';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #f00; /*or your variant*/
}https://stackoverflow.com/questions/40926379
复制相似问题