cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Multiple Objects on Google Maps Widget

drieder
15-Moonstone

Multiple Objects on Google Maps Widget

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

1 ACCEPTED SOLUTION

Accepted Solutions
wposner-2
12-Amethyst
(To:drieder)

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.

View solution in original post

6 REPLIES 6
slangley
23-Emerald II
(To:drieder)

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

drieder
15-Moonstone
(To:slangley)

Hello Sharon,

 

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

 

Best Regards,

Dominik

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. 

drieder
15-Moonstone
(To:zyuan1)

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-2
12-Amethyst
(To:drieder)

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.

slangley
23-Emerald II
(To:wposner-2)

Hi @drieder.

 

If one of the solutions provided answered your questions, please mark it as the Accepted Solution for the benefit of others who may have the same question.

 

Regards.

 

--Sharon

Top Tags