Skip to main content
1-Visitor
October 16, 2018
Solved

Multiple Objects on Google Maps Widget

  • October 16, 2018
  • 2 replies
  • 2574 views

Hello everyone,

 

I would like to show the location of multiple Things in one Google Maps Mashup. I have read this thread, but i would like to avoid using an infotable.

 

Instead I have all the Things that I want to display the location from in a Data Table. The Data Table has the Names of the Things as entries.

 

Does anyone know how I can access the location property of all Things in the Data Table and show it on the Map in the Mashup Builder?

 

Thank you for your help.

 

Best Regards,

Dominik

Best answer by wposner-2

You MUST return an infotable with the location property in order for the map widget to work.  There is no way for the map widget to run code that loops over your things and gets the location property.  The point of the infotable is to act as an object that contains all the data needed for the (map) widget to function correctly.

2 replies

Support
October 17, 2018

Hi @drieder.

 

Which version of ThingWorx are you running?  I'll need to do some testing to confirm that I fully understand your issue.

 

Regards.

 

--Sharon

drieder1-VisitorAuthor
1-Visitor
October 18, 2018

Hello Sharon,

 

sorry for the late reply. I am working with ThingWorx Version 8.2.6.

 

Best Regards,

Dominik

5-Regular Member
October 18, 2018

Hi, The Google Map widget only accept infotable as the input for the location Markers, so there's no way you can avoid using infotable here.

 

But I believe what you mean by "no infotable" is that you don't want to store all of the Markers information in an infotable shaped property, and that's a correct behavior.

 

The infotable is just a temporary storage unit for a collection of data, so it's not safe to keep important data in infotable property in Thing entities, a DataTable or Stream would be better choices. And when you need to use the data, you can use services like GetDatatableEntries to get an infotable result from the Datatable and send it to the Google Map, in this transaction process, your data is safe with infotable anyway. 

drieder1-VisitorAuthor
1-Visitor
October 18, 2018

Hello @zyuan1,

 

thank you for your reply. You are correct, I dont want to store the location of entities in a table, because the entities themself already have a property which contains their location. 

 

Thats why I only wanted to only store the Things (or rather Thingnames) in the Datatable and then somehow access their location property. 

 

I am going to try it out with Streams and let you know how it worked.

 

Best Regards,

Dominik

wposner-21-VisitorAnswer
1-Visitor
October 19, 2018

You MUST return an infotable with the location property in order for the map widget to work.  There is no way for the map widget to run code that loops over your things and gets the location property.  The point of the infotable is to act as an object that contains all the data needed for the (map) widget to function correctly.