Skip to content

Commit

Permalink
Changed: Geolocation: Updatd component documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ffehring authored and ffehring committed Aug 13, 2024
1 parent 354084b commit af62ed6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
12 changes: 11 additions & 1 deletion js/userinterface/geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var explaincomponent_options = {
componentName: 'Geolocation'
};

// Example 1
var geoloc_example1_options = {
onLocateFunctions: [
function(position){
Expand All @@ -15,4 +16,13 @@ var geoloc_example1_options = {
document.addEventListener('swac_geoloc_example1_geolocation_newlocation',function(e) {
console.log('New geolocation recived: ', e.detail.position);
console.log('New geolocations address: ', e.detail.address);
});
});

// Example 3
var geoloc_example3_options = {
plugins: new Map()
};
geoloc_example3_options.plugins.set('MagicMapperInterface', {
id: 'MagicMapperInterface',
active: true
});
22 changes: 21 additions & 1 deletion sites/userinterface/geolocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<h3>Example 1: Use geolocation over function</h3>
Create a ask for geolocation useage with more user compfort options and
more data security.

<div id="geoloc_example1" swa="Geolocation"></div>

<pre><code class="lang-html">
&lt;div id="geoloc_example1" swa="Geolocation"&gt;&lt;/div&gt;
</code></pre>
Expand All @@ -48,7 +51,6 @@ <h3>Example 1: Use geolocation over function</h3>
]
};
</code></pre>
<div id="geoloc_example1" swa="Geolocation"></div>

<h3>Example 2: Use geolocation by event</h3>
<p>When a new geolocation is found, the swac_REQUESTORID_geolocation_newlocation event is fired.
Expand All @@ -59,6 +61,24 @@ <h3>Example 2: Use geolocation by event</h3>
console.log('New geolocation recived: ', e.detail.position);
console.log('New geolocations address: ', e.detail.address);
});
</code></pre>

<h3>Example 3: Use MagicMapper Plugin</h3>
<p>MagicMapper is a device to improve location accuracy. It can be used with help of an API and the MagicMapperPlugin.
<br>When activated an additional icon is shown in the geolocation bar. With click on that icon a dialog opens.
Enter the address of the MagicMapper interface here. The plugin checks the connectivity and updates positions with
locations from the MagicMapper.</p>

<div id="geoloc_example3" swa="Geolocation"></div>

<pre><code class="lang-javascript">
var geoloc_example3_options = {
plugins: new Map()
};
geoloc_example3_options.plugins.set('MagicMapperInterface', {
id: 'MagicMapperInterface',
active: true
});
</code></pre>

</article>
Expand Down

0 comments on commit af62ed6

Please sign in to comment.