如何使用ZK Framework在Gmaps上动态填充Gmarker

问题描述 投票:0回答:1

我需要帮助来通过我的数据库中的数据lng和lat动态填充Gmarker并在我的ZK应用程序中显示,我正在使用Gmaps v.3.0.4

我在zul文件中添加了标记并尝试使用forEach但只显示了一个标记。

<gmaps version="3." id="gmaps" width="100%" showZoomCtrl="true" lat="@bind(vm.lat)" lng="@bind(vm.lng)" height="500px"  protocol="https" >
    <gmarker forEach="@load(areaList)" lat="@bind(each.lat)" lng="@bind(each.lng)" open="true">
    </gmarker>
</gmaps>`

标记应尽可能显示。

这是我的完整代码ZUl fileViewmModel

java mvvm google-maps-api-3 zk
1个回答
0
投票

尝试:

<gmaps version="3." id="gmaps" width="100%" showZoomCtrl="true" lat="@bind(vm.lat)" lng="@bind(vm.lng)" height="500px"  protocol="https" children="@load(vm.areaList)">
    <template name="children">
        <gmarker lat="@load(each.lat)" lng="@load(each.lng)" open="true" />
    </template>
</gmaps>

我没有测试过,但希望它有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.