Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello,
I am Newbie to Thingworx,
I want to highlight multiple Locations on Google map.
[Example-3 Different locations with the marker]
I have created a Data Table and included the different Location's inside it in another Data Table, But after binding it to the Google Map 'm unable to get the desired output.
Kindly suggest, How do i get those multiple Locations on the Google Map.
Regards & Thanks
Arpitha.P
As long as you have a Service that returns an infotable with Locations, the map can display that.
Bind the data to the Map and then make sure you set the 'Location' Property of the Map Widget, indicating which column has the locations.
If you check your actual output, you'll find that creating an infotable based on a datashape just gives you an empty infotables with no records inside.
Also this most likely isn't the best way to retrieve the information.
If you have not yet done so, I recommend you go through the online training. The online training will point you in the direction of best practice modeling and what are appropriate services to use.
okay...Thank you
Pai,
I have gone through the Online Tutorial, in the following link.
https://precisionlms.ptc.com/
I followed the Course to map multiple locations to Google map, but I'm able to map only one Location.Could you please provide me the tutorial link for adding multiple Locations in the Google map.
Thanks
hello
I'm trying to access the tutorial videos but I can not do that! can you please help me with that??
Waseem, we have couple video tutorials at the Help Center, and ThingWorx learning paths are available at the PTC University site which I believe you would have to register for.
Follow the steps for require multiple marker in your Google Map :
Create service in your Things or Thing Template
Add below code in your Service . Before Add create DataShape .
var params = {
infoTableName : "InfoTable",
dataShapeName : "Datasahpe"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(Datasahpe)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// location:LOCATION
var location = new Object();
location.latitude = 23.452;
location.longitude = 72.124;
location.elevation = 0;
location.units = "WGS84";
result.AddRow({location:location})
//location:LOCATION2
var location2 = new Object();
location2.latitude = 23.123;
location2.longitude = 72.456
location2.elevation = 0;
location2.units = "WGS84";
result.AddRow({location:location2});
Thanks,
Mayank
1.In the Field Definitions i have added 2 Locations
Name:Bangalore
Base type: Location
Has Default value:Yes
Default Value:12.8896959,77.5429539 (latitude and Longitude)
Similarly i added another location in the same way...
b) In the service , i have done as follow Input-Location
BaseType-BaseTypeNameOutput ,
BaseType:Infotable
DataShape: Axcend_Table (Correct me if 'm wrong here)Snippet- i added this from 'Create Infotable from datashape' under snippetvar params = {
infoTableName : "InfoTable",
dataShapeName : "Axcend_Table"
};// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(Axcend_Table)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);These all the steps i have done..But still 'm unable to get the output...Please suggest me if 'm wrong some where..
Regards & ThanksArpitha.P