Cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use Webcomponents as Fleetmanager Plug In ? How ? Samples available ?

Siemens Creator Siemens Creator
Siemens Creator
3 REPLIES 3

Re: Can I use Webcomponents as Fleetmanager Plug In ? How ? Samples available ?

Genius
Genius

Sure you can...!

 

1. Get the plugin demo from SIOS

2. Integrate the webcomponents url in the head of the html

<script id="mdsp-webcomponents-loader" type="text/javascript" src="https://static.eu1.mindsphere.io/webcomponents/v1/index.js" ></script>

3. Add the component somewhere in the body

<div class="list-group-item list-group-item-action flex-column align-items-start">
   <mdsp-event-view style="height: 300px; width: 100%"></mdsp-event-view>
</div>

4. Connect the asset id from the plugin to the event component

fmProxy.assetId.subscribe(assetId => {
    document.querySelector('mdsp-event-view').assetId = assetId;
    document.getElementById('asset-id').innerHTML = assetId;
});

Optional set the scope for the used component in Developer Cockpit, update csp header and push and register the plugin.

 

As example, here we are:

image.png

 

 

Re: Can I use Webcomponents as Fleetmanager Plug In ? How ? Samples available ?

Siemens Creator Siemens Creator
Siemens Creator

Thx !

I want to integrate the map component and update the coordinates coming from an (moving) asset from time to time.

is it the same approach ?

where do i have to add some code to update the map with new coordinates ? 

Re: Can I use Webcomponents as Fleetmanager Plug In ? How ? Samples available ?

Genius
Genius

This has been solved offline.

But for interested readers - yes, same approach:

  • You can ask the assetmanagement for the location of given asset cyclically.
  • The location you can use for the map component.