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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Displaying Multiple Locations in Google Map

aprabhakara
1-Newbie

Displaying Multiple Locations in Google Map

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

8 REPLIES 8

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.

I have many queries regarding this google Map widget.I kindly request you to guide me.

a) As you have mention, i have a service which returns the Infotable with locations.

i have created an Infotable with name [Axcend_Table] in this way.
     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-BaseTypeName

Output ,
BaseType:Infotable
DataShape: Axcend_Table (Correct me if 'm wrong here)

Snippet- i added this from 'Create Infotable from datashape' under snippet

var 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 & Thanks

Arpitha.P

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??

Aanjan
9-Granite
(To:wozan)

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

Top Tags