【问题标题】:Count seats provided in a svg image计算 svg 图像中提供的座位数
【发布时间】: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(&quot;#adjacent-seats-available&quot;); 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)到一个街区的座位数。我不知道如何“连接”&lt;path&gt;tag Osttribüne(Reihen 1-17),点击它,然后点击&lt;button&gt;“选择您的座位”,然后我来到一个新的特定站点,其中我可以数座位。显然,我的目标是进入 SVG 图像中的每个块并计算它们。而且我不知道如何将每个街区与这个街区后面的座位连接起来。

我什至不知道我应该使用哪种技术。我想也许它是 XML 和 Javascript 的组合或类似的东西。

【问题讨论】:

    标签: javascript xml svg counting


    【解决方案1】:

    SVG 图像中的每个座位都由 &lt;circle&gt; 元素表示。

    您可以通过查看data-simpleid 属性来判断座位状态(如果需要)。已占用/不可用的座位如下所示:

    <circle cx="1679.6000000000001" cy="155.6" r="8" index_reihe="8" index_sitz="91" sitz_nr="9" style="fill: url(&quot;#taken-seat&quot;);" 
            data-simpleid=""></circle>
    

    可用座位如下所示:

    <circle cx="114.4" cy="173.8" r="8" index_reihe="9" index_sitz="5" sitz_nr="95"             style="fill: rgb(218, 33, 239);" data-color="#da21ef"
            data-simpleid="2" data-complexid="105422" data-original-title="" title=""></circle>
    

    未设置的空data-simpleid 表示已采取。 “1”、“2”或“3”的值表示座位价格。

    【讨论】:

    • 谢谢,但这不是我的问题。我的问题是 - 因为我只有起始 URL - 我如何(例如使用 Javascript)从第一层(完整的therer,具有不同的块)到第二层(当我点击一个块并想要选择一个座位)然后数座位。
    猜你喜欢
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 2016-08-31
    • 2011-03-12
    • 2013-12-27
    • 2015-10-12
    • 2019-07-01
    相关资源
    最近更新 更多