2016-12-02 119 views
0

地图自动生成并自动生成地图标记到地图。在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"

链接给出是否有可能tooverwrite这与新的链接CSS来标记?

回答

1

CSS无法更改元素的属性,请使用js。 CSS仅用于视觉效果。

document.getElementById('Geometry_Point').setAttribute('xlink:href', 'http://google.com') 

只要确保没有JS已经采取该值并使用它缓存。

0

制作层上图标与::after CSS伪选择 像这样: CSS:

#Geometry_Point::after { 
    content: ''; 
    position: absolute; 
    left: 0; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    background: #f00; /*or your variant*/ 
}