簡體   English   中英

在jvector地圖上兩個標記之間繪制的線的末端繪制箭頭

[英]Draw arrow at the end of line drawn between two markers on the jvector map

我正在嘗試在地圖上任何標記之間的線的末端繪制一個箭頭 我正在使用svg創建行:

var map = $('#map').vectorMap('get', 'mapObject');
var draw = SVG('svgMapOverlay').size(660, 400);
var coords1 = map.latLngToPoint(markerArray[0].latLng[0],markerArray[0].latLng[1]);
var coords2 = map.latLngToPoint(markerArray[1].latLng[0],markerArray[1].latLng[1]);
draw
 .path()
 .attr({ fill: 'none',stroke: '#c00', 'stroke-width': 2 })
 .M(coords1.x, coords1.y)
 .L(coords2.x, coords2.y);

我能夠在兩個標記之間畫線,但不能畫線尾的箭頭。 我想要的是這樣的:

http://jsfiddle.net/Z5Qkf/1/

這是JSFiddle http://jsfiddle.net/ruzel/V8dyd/上的示例jvectormap

您能幫我什么忙還是建議一些選項,因為我是SVG的新手,並且使用SVG在JavaScript中繪制對象。 謝謝

我做的。

如果有人正在尋找答案,這就是我所做的: https : //github.com/mushtaqak/fancyWorldMap

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM