如何使用 ZK Framework 在 Gmaps 上动态填充 Gmarker
How to populate Gmarker dynamically on Gmaps using ZK Framework
我需要帮助通过我的数据库中的数据 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 file and ViewmModel
尝试:
<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>
我还没有测试过,但希望它能有所帮助。
我需要帮助通过我的数据库中的数据 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 file and ViewmModel
尝试:
<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>
我还没有测试过,但希望它能有所帮助。