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

How to display the location of multiple objects on a google map and on clicking one object we get its location details.

SOLVED
Highlighted
Newbie

How to display the location of multiple objects on a google map and on clicking one object we get its location details.

we want to display the location of multiple objects on a google map at the same time and on clicking one marker we should get complete location details of that object.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hello Priyanshi,

1. The easiest way.

​If your service that populates the Google Map returns also the additional attributes that should be shown when marker is selected, you can bind the SelectedRows of your service with the grid - this way, when you select the marker, a whole data regarding selected record will be passed to the grid:

2. The more flexible way.

If you don't have the data as an result of the same service or don't want to use the previous way, you can pass the selected location parameter to additional service that returns more data:

Hope that clarifies a little bit. In case of any questions, don't hesitate to ask.

Regards,

J.

View solution in original post

16 REPLIES 16
Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Use Google Maps widget that's on the marketplace: https://marketplace.thingworx.com/Items/google-widgets

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hello Priyanshi Saxena​,

You can use Google Map widget. It's easy. Just need to pass an infotable with at least one Location type field to the Data field and then pick this field in the LocationField widget property. Don't forget to mark true ShowMarkers property (but don't worry, it's true by default).

Hope it helps, let me know if you need any additional questions.

Regards,

J.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Jakub,

Yes it worked, I am able to display multiple locations but how to display the data associated with those locations in the infotable (i.e other fields in the infotable) on selecting any marker on the map.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hello Priyanshi,

1. The easiest way.

​If your service that populates the Google Map returns also the additional attributes that should be shown when marker is selected, you can bind the SelectedRows of your service with the grid - this way, when you select the marker, a whole data regarding selected record will be passed to the grid:

2. The more flexible way.

If you don't have the data as an result of the same service or don't want to use the previous way, you can pass the selected location parameter to additional service that returns more data:

Hope that clarifies a little bit. In case of any questions, don't hesitate to ask.

Regards,

J.

View solution in original post

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Priyanshi Saxena​ I think you would require to use Tooltip option for that.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Ankit,

Yes I have enabled the tooltip option but nothing shows.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Priyanshi Saxena​,

It works fine for me. I passed all data (Location, Tooltip details) as data to Google Map. Then selected my LocationField and TooltipField properties from the dropdown and it shows data as expected.

What are the exact steps that you are following.

Capture.JPG

Thanks,

Ankit Gupta

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Ankit,

I have a thing which has 3 properties

1. LocationDetails(infotable which has coordinates of latitude and longitude)

2. Username(String)

3. Address(String)

In my mashup I have used the service getProertyValues and binded the all data of this dervice to the data of google map.

In the LocationField dropdown I get the option of my LocationDetails infotable and in the tooltipField dropdown I get no option.

I want the username and address to be displayed as tooltip.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Priyanshi Saxena​, So yo want to show same Tooltip detail for all locations? You can try binding the individual property directly to corresponding Tooltip field.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Ankit,

No I want the tooltip for that particular location(Different for every location) i.e for every location coordinates in the LocationDetails infotable there will be details corresponding to that which will act as tooltip.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Priyanshi,

Above is my previous answer that shows how to do that using SelectedRow and another service. Have you tried it before?

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Jakub,

Yes I did try with the Selected Rows method but still its not working.

Moreover I don't want to display the details in the grid, rather I want it as tool tip in the map itself.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi,

You're using GetPropertyValues OOTB service? In that case you can't do that, because this service doesn't have the DataShape on the output InfoTable. And if there's no DataShape on the result InfoTable, the Mashup Builder cannot "see" those fields. In your situation the best would be to create a custom service that would return all necessary properties as an InfoTable - but remember to create the DataShape with appropriate fields and set it as output InfoTable DataShape.

Regards,

J.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Hi Jakub,

Yes I am now able to display the details using my own customized service.

Thank you Ankit Gupta​ and Jakub Kaczynski

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

Priyanshi Saxena​, That's Great! Could you please mark the correct answer and update helpful comments so that other community member know this Thread has a solution and which comments helped you resolve it.

Highlighted

Re: How to display the location of multiple objects on a google map and on clicking one object we get its location details.

HI Jakub Kaczynski​, Hope you are doing well.I have question please.

i have used info-table to present multiple locations, each location point has some few properties that i could manage to show once the location point is clicked
Now, i need to present infotable as one of the data presented on each location point, so infotable within infotable, but actually data is shown in below format

it shows [object Object] instead of showing the content of info table, could you please assist

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!