I am a developer trying to build a google data studio connector for people to connect to. The code handles other data types pretty well, but it seems to not work with Latitude,Longitude data types. Here is what I am currently doing to handle Latitude,Longitude datatype:
in getSchema():
var cc = DataStudioApp.createCommunityConnector();
var fields = cc.getFields();
var types = cc.FieldType;
fields.newDimension()
.setId(id.toString())
.setName(nameOfField)
.setType(types.LATITUDE_LONGITUDE);
And in getData(), I simply return the string representation of Latitude, Longitude such as -1.123333, 1.12323 for each row.
This code works when I just view the geo data as a table such as follows: sample geo data in table form
However, when I try to plot these geo data in bubble map, I just get the plot of one single data point, as follows: bubble map (only see one point)
Any ideas of why this happens? I am getting the data correctly since the table form gives the right data, just don't know how to display all these geo data correctly? Or should I use a different type when I parse the schema for Latitude, Longitude?
Any help is greatly appreciated!
getDataand not ingetFields. So my bet is that, if you mimic the wrong behavior in Google Sheets, it will be easier to understand what is wrong with your connector. - Diego Queiroz