【发布时间】:2019-12-04 18:33:39
【问题描述】:
我想计算 SVG 图像中的座位数。问题是图像是一个剧院/大厅,而这个剧院有不同的街区/部门。像这儿: https://www.wien-ticket.at/en/shop/index.php3?shopid=263&setsession=86hbtra3lilao85mip5rl31om6d164&gotoperformance=143703
所以这里我们有剧院和它的街区。这里没有座位数,我发现不需要使用开发工具计算座位数。
假设我点击“Osttribüne Reihen 1-17”(英语:east stand row 1-17),然后点击选择您的座位。然后我来到概览,我可以在那里数座位。
到目前为止,我什么都没试过,因为我不知道它是如何工作的。通常我会通过给定 URL 的此类售票店进行计数。例如,每个块都有自己的 URL,我获取它并通过灰色座位数。在此页面上,我始终使用相同的 URL。因此,当我单击 svg 图像中的特定位置时,我会更深入。
这是 svg 的开始:
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:docname="WT saalplan halleD svg 24042018 wwe 01.svg" inkscape:version="0.91 r13725" version="1.1" height="830" width="850" id="svg3141" viewBox="0 0 850 830" style="width: 684.9px; height: 668.728px;">
...
</svg>
“Osttribüne (1-17) 有一个标签,它提供以下信息:
<path id="polygon7-9" d="m 266.76366,530.47852 0,105.9 316.09996,0 0,0 0,-105.9 z" style="display: inline; fill: url("#adjacent-seats-available"); fill-opacity: 1; stroke: rgb(68, 68, 68); stroke-opacity: 1; stroke-width: 0px;" inkscape:connector-curvature="0"></path>
我认为这里没有任何有用的东西。当我检查“选择您的座位”按钮时,我认为唯一有用的是 def 工具中的“id”
<button type="button" class="btn <!--btn-primary-->
btn-custom-primary btn-block btn-seat-select text-uppercase"
data-block-id="635960" data-elem-id="gsectorO1">
Select your seat
</button>
也许我可以用它做任何事情。
所以我的主要问题是:我如何从起点(给定 URL)到一个街区的座位数。我不知道如何“连接”<path>tag Osttribüne(Reihen 1-17),点击它,然后点击<button>“选择您的座位”,然后我来到一个新的特定站点,其中我可以数座位。显然,我的目标是进入 SVG 图像中的每个块并计算它们。而且我不知道如何将每个街区与这个街区后面的座位连接起来。
我什至不知道我应该使用哪种技术。我想也许它是 XML 和 Javascript 的组合或类似的东西。
【问题讨论】:
标签: javascript xml svg counting