2016-12-02 122 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*/ 
}