<?xml version="1.0" encoding="UTF-8"?> <model package="towersite" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1"> <object class="TowerSite" table="towersite" extends="xPDOSimpleObject"> <field key="siteid" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="state" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="township" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="address" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="lat" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="lng" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="towertype" dbtype="varchar" precision="255" phptype="string" null="false" default=""/> <field key="pos" dbtype="int" precision="10" phptype="integer" null="false" default="0"/> <field key="createdon" dbtype="datetime" phptype="datetime" null="true"/> <field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" /> <field key="editedon" dbtype="datetime" phptype="datetime" null="true"/> <field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" /> <field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" /> <field key="deletedon" dbtype="datetime" phptype="datetime" null="false" /> <field key="deletedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" /> <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" /> <field key="publishedon" dbtype="datetime" phptype="datetime" null="false" /> <field key="publishedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" /> <aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign"/> <aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign"/> </object> </model>
[[!migxLoopCollection? &packageName=`towersite` &classname=`TowerSite` &selectfields=`id,siteid,state,township,address,towertype,lat,lng` &toJsonPlaceholder=`markers` ]] [[+markers]]
markers = [ { "siteid": "BNK1001", "state": "Bangkok Metropolitan Area", "township": "Thonburi", "address": "21 de laetya street", "towertype": "Rooftop", "lat": 16.829394, "lng": 96.155004 }, { "siteid": "BNK1002", "state": "Bangkok Metropolitan Area", "township": "Phra Khanong", "address": "Block 5, 12 Old Khanong Road", "towertype": "Rooftop", "lat": 16.827123, "lng": 96.164543 }, ];
This question has been answered by jimmyjazz. See the first response.
[[!migxLoopCollection? &packageName=`towersite` &classname=`TowerSite` &selectfields=`id,siteid,state,township,address,towertype,lat,lng` &toJsonPlaceholder=`markers` ]] <script>markers = [[+markers]]</script>