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 the Community Ranking System, a fun gamification element of the PTC Community. X

dynamic devices icons & tooltip mashup on google map widget

pjoly
12-Amethyst

dynamic devices icons & tooltip mashup on google map widget

Hello

I'm using the google map widget to display things (devices) on a map.

I works well using "GetImplementingThingWithData" -> AllData : I can get all my devices with a marker on a map, select one from map or from a table (grid)

I'm trying to improve but I did not success for these following

1/ to put an  icon which is defined in the propertites of the device (it can change dynamically depending of the data received for the device) . I can use the avatar but not this image (this image works well into a grid widget)

2/ when the mouse is on a device, to open a tooltip mashup instead of simple tooltip text : how to initialize this mashup with the data of the selected device ? (how to pass the selected thing in parameter of the mashup before to display it)

Thanks

15 REPLIES 15
AnnaAn
14-Alexandrite
(To:pjoly)

Hello,

Welcome to post your questions on ThingWorx Community!

For your two questions:

1.Could you explain more? Do you mean that you want to display a device property with BASETYPE of IMAGE or IMAGELINK?

2. Yes you could feel free to pass parameters from the parent mashup to the tooltip mashup. Please check this article how to do it

   from Here.

Thanks!

pjoly
12-Amethyst
(To:AnnaAn)

Hello

thanks for the guidance.

for 1/ I'm using an "IMAGELINK" type for the icon.

And I am able to modify the link into the javascript code when data is received .

Regards

Pascal

pjoly
12-Amethyst
(To:AnnaAn)

Hello

for point 2/ I followed the explanations from your link but I did not find how to bind the ToolTip mashup Parameters from the main mashup (which contains the google map widget) :

  • Bind the Driver, Speed, BrakesOn, and Name parameters from the GetImplementingThingsWithData service to the properties of the Google Map widget

My parameters defined for the tooltip mashup (and associated to its widgets)  are not selectable when I'm trying to bind the properties from GetImplementingThingsWithData .

Should I use the same name for parameters and for the properties ? (some are not allowed)

Thanks

pjoly
12-Amethyst
(To:pjoly)

To pass parameters to the TooltipMashup from googlemap widget I found a similar thread here :

GoogleMap widget TooltipMashup - using the hover-over location?

It is written by  Quang-Dung Ngo

n the GoogleMap widget, when you add the SpecifyTooltipMashup to the TooltipMashupName parameter of the GoogleMap widget, at the end of the properties list of the GoogleMap widget, you can see new properties which are the mashup parameter of the SpecifyTooltipMashup.

Then, you can bind the location name of your principal mashup to a locationParameter of the mashup SpecifyTooltipMashup's parameter.

But I cannot find where to add new properties info Google map widget ?

Also i'm still not able to use IMAGELINK property as location marker ...

Thanks

qngo
12-Amethyst
(To:pjoly)

1) In the mashup used as the TooltipMashup, add some Mashup parameters (A) (Configure Mashup Parameters). Then, when this tooltip mashup is provided in the TooltipMashupName of the Google Map widget, new properties from Mashup parameters (A) will be added to the Google Map widget.

2) To display different icons on the map, I used the property MarkerFormatting of the Google Map widget (State-based Formatting, with a new StateDefinition). In this case, you would need to modify your service to provide a "state/condition" field.

pjoly
12-Amethyst
(To:qngo)

Works great for 1) !

(my mistake : I was trying to drag/drop the property to bind with the googlemap widget instead of selecting it in the list of properties)

I'll work on your recommandation for the icon (MakerFormating) for 2)

Thanks a lot

pjoly
12-Amethyst
(To:qngo)

Hello

I created a MakerFormatting with a state based formatting for google map widget but I cannot find how to act on the different markers with this MarkerFormatting property afterwards ??

qngo
12-Amethyst
(To:qngo)

As I can see on the maps, there are 2 markers for two states On and Off. What would you like to do afterwards?

pjoly
12-Amethyst
(To:qngo)

hello

the idea is to have a different markers depending of the state of the device.

for exemple I put lights in a city and I want to see the lights on and the lights off on the map (I  used the green and red points to start but I'll use a light icone such as I can use without poroblem  in a  grid widget or an image widget

qngo
12-Amethyst
(To:pjoly)

Hello, so you can create:

- 2 Style Definitions with 2 icons "light off" and "light on" (like the State Definition "OnOff")

- a new StateDefinition with two states OFF and ON corresponding to the new 2 Style Definitions created (like two Style Definitions "Error" and "Available")

pjoly
12-Amethyst
(To:qngo)

Hello

yes that I can do easily. My problem is how to see these icons on the map ?

I do not understand how the "MakerFormatting" item is interacting with the different markers on the map ?

qngo
12-Amethyst
(To:pjoly)

The MarkerFormatting will replace the MarkerStyle and display different markers according to the state "EtatAllumage". Of course the property ShowMarkers is checked.

pjoly
12-Amethyst
(To:qngo)

OK I found my mistake :

it was a mix between 0,1   false,true  ON,OFF in the state value definitions (in case of mistake the standard markers are used)

Now I can see it and I have to improve the icons  following this principle

I can see new properties in the google map widget for each state, should I have to bind also them despite I selected the data in the MarkerFormating definition ?

Thanks for your very usefull support!

qngo
12-Amethyst
(To:pjoly)

Glad that it works. I read a PTC article about the issue of the type boolean with State Definition: State Definition couldn't be created based on Boolean Values in ThingWorx (https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS258039).

I did not bind any thing to these new properties MarkerFormatting_....

pjoly
12-Amethyst
(To:qngo)

Yes, I have seen at least that true & false are inverted .

I'll create a new property to avoid boolean (I have to add "unknown" state)

Thanks

Announcements


Top Tags