Seems to me you could very easily use loSer.Serialize("cursor:Markers") and then when done simply replace the "Rows": with "markers": in the resulting string. Since google expects all lower case as wwJsonSerializer produces that should work.
Or maybe even easier using code like this:
DO wconnectCREATECURSOR Markers ( latitude n (12,6), longitude n(12,6),icon c(50),title c(30),content m)INSERT INTO Markers (latitude,longitude,icon,title,content) ; VALUES (20.90275, -156.37149,"asdasd","Hello World","Paia ")INSERT INTO Markers (latitude,longitude,icon,title,content) ; VALUES (45.708851, -121.510727,"asdasd","Hello World","Hood River") loCol = CursorToCollection(,2) loObj = CREATEOBJECT("EMPTY")ADDPROPERTY(loObj,"markers") loObj.Markers = loCol loSer = CREATEOBJECT("wwJsonSerializer") lcJson = loSer.Serialize(loObj) ShowText(lcJson)
You'll need the CursorToCollection helper that's been added to Web Connection in the latest release:
************************************************************************ * CursorToCollection **************************************** *** Function: Creates a collection from a cursor *** Assume: *** Pass: lcAlias - Optional Name of the table/alias *** if not passed *** lnMode - 0* - FoxPro Collection, 2 - wwCollection *** Return: Collection from cursor or NULL on failure ************************************************************************FUNCTION CursorToCollection(lcAlias, lnMode)LOCAL loResult, loRow, lcClass, lcOldAlias lcOldAlias = ""IF !EMPTY(lcAlias) lcOldAlias = ALIAS()SELECT (lcAlias)ENDIFIFEMPTY(lnMode) lnMode = 0ENDIFIF lnMode = 2 lcClass = "wwCollection"&& avoid pulling into projectELSE lcClass = "Collection"ENDIF loResult = CREATEOBJECT(lcClass)SCAN loRow = nullSCATTERNAME loRow MEMO loResult.Add(loRow)ENDSCANIF !EMPTY(lcOldAlias)SELECT (lcOldAlias)ENDIFRETURN loResultENDFUNC* CursorToCollection
The above produces output like this:
{"markers":[ {"content":"Paia","icon":"asdasd","latitude":20.902750,"longitude":-156.371490,"title":"Hello World"}, {"content":"Hood River","icon":"asdasd","latitude":45.708851,"longitude":-121.510727,"title":"Hello World"} ]}
Hope this helps,
+++ Rick ---