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

How to bind selected location from tree widget to google map widget

Newbie

How to bind selected location from tree widget to google map widget

Hi All,

I am new to Thingworx and i am facing the below issue.

I have taken tree widget and it displays few location of XYZ country. (I have "Location" column in my data table which contains longitude and latitude of those locations).

I have also used google map widget parallel to tree widget in mashup.

When a location is selected from tree widget it should navigate to that location on google map and show the actual location.

I have bit confusion in binding.

Please advise.

17 REPLIES 17

Re: How to bind selected location from tree widget to google map widget

Hi Omkar Darde​,

As per my understanding; you need to bind the Location (from the Service feeding Google Map -> Selected Row(s) -> Location) with the SelectedLocation Property of the Google Map.

I hope it helps.

Re: How to bind selected location from tree widget to google map widget

Hi Omkar Darde​,

If you are still not sure how to implement, here is an example for your reference(Attachment).

And below is the data in my DataTable:

Thanks,

Br,

Anna

Re: How to bind selected location from tree widget to google map widget

Hi Anna An,

I am actually looking for something like, when a I select (Continent>>>Country>>>City) from the tree, in the backend i have stored longitude and latitude of the all the city in a data table. Now based on my selection that is the city selection googles maps must show that city. So basically when I click on the city the latitude and longitude must be passed be google maps.

Thanks.

Omkar Darde

Re: How to bind selected location from tree widget to google map widget

Hi Ankit,

I am actually looking for something like, when a I select (Continent>>>Country>>>City) from the tree, in the backend i have stored longitude and latitude of the all the city in a data table. Now based on my selection that is the city selection googles maps must show that city. So basically when I click on the city the latitude and longitude must be passed be google maps.

Thanks.

Omkar Darde

Re: How to bind selected location from tree widget to google map widget

Hi Omkar Darde​,

I understand. Did you check my example? It also displayed the Country name, but actually when I choose a Country, it will actually pass the Location value to the Google map, and only difference is that I only made one level hierarchy for the Country. This is done by configuring your Tree parameter like(i):

please let me know if it's not your case.

Thanks,

Br,

Anna

Re: How to bind selected location from tree widget to google map widget

Hi Anna An,

I went through your backup and tried in similar way, but the tree widget itself is not working since the input of free widget has to be in in the below specified format -

So we see there is 3 level of data which needs to be shown in the tree. The problem that we face is getting the location from this service and binding it to the google maps. Also please tell us how we can attach our backup xml here so that you can run and see it.

Thanks

Omkar

Re: How to bind selected location from tree widget to google map widget

Hi Omkar Darde​,

It should be similar when saying it's 1 level or 3 level. You need configure the Tree widget correctly to make it display on your tree.

And you also need add a new field in your dataTable with a Location field which will store the Location of a City/Country(or where you store the Location field please? isn't it in the same datatable?).

To attach your entities/data, you could switch the edit mode to Advanced with "Use advanced editor" on top right of the editor, and then you could attach files.

I will test against your data after you uploaded them.

Thanks,

Br,

Anna

Re: How to bind selected location from tree widget to google map widget

Hi Anna An,

I am attaching my mashup, datashape and thing. I am successful in getting data in tree but stuck at transferring the data to map. I have written two services one for tree widget and other for fetching latitude and longitude based on the node selection from the tree. I have tried using select breadcrumb option. But my final agenda is to pass location based on city/plant selection from tree widget to google maps and display it there.

If you want you can write one service to fulfill the expected functionality. If you need any more details. Please let me know. Thanks for all your support.

Regards

Omkar Darde

Re: How to bind selected location from tree widget to google map widget

Hi Omkar Darde​,

Could you please refer to my comment in the following Thread Re: What does "breadcrumb select" in tree widget provides as a output ?? to see if it helps.

I think you are also looking for same information.