Skip to content

Commit

Permalink
fix object caching in example 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nickw1 committed Nov 17, 2024
1 parent 4c8b70b commit 069774d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/04-api-communication/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>three.js</title>
<script type="module" crossorigin src="/locar.js/assets/04-api-communication-WpYkYZAO.js"></script>
<script type="module" crossorigin src="/locar.js/assets/04-api-communication-CSUchSy2.js"></script>
<link rel="modulepreload" crossorigin href="/locar.js/assets/locar.es-D2pHxP8J.js">
</head>
<body>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ <h1>LocAR.js examples</h1>
<ol>
<li><a href='01-helloworld/index.html'>Hello World</a>: Display a red cube just to the north of a fake GPS location. Can be tested on a desktop or laptop.</li>
<li><a href='02-gps-and-sensors/index.html'>GPS and Sensors</a>: Requires a mobile device wih GPS and sensors. Demonstrates use of the GPS and the device sensors to show real AR. Gets your initial location and displays four coloured boxes to the north (red), south (yellow), west (blue) and east (green) of your initial location. Can be used as a test to check whether your device sensors are accurate; if the red box does not appear to the North, your device sensors may be mis-calibrated.</li>
<li><a href='03-ar-objects/index.html'>AR Objects</a>: shows how you can add real AR objects with a given latitude and longitude and properties. Also shows how you can detect clicks on objects: when an object is clicked a popup displaying the object name appears. Uses a hard-coded "fake" location and hard-coded objects, and you can rotate the three.js camera using the mouse, so will work on a desktop or laptop.</li>
<li><a href='04-api-communication/index.html'>API Communication</a>: shows how you can communicate with a live GeoJSON API and create AR objects from the GeoJSON returned. Objects are clickable, as in example 3. Requires a real mobile device as it uses the sensors to detect device orientation.</li>
<li><a href='03-ar-objects/index.html'>AR Objects</a>: shows how you can add real AR objects with a given latitude and longitude and properties. Also shows how you can detect clicks on objects. Uses a hard-coded "fake" location and hard-coded objects, and you can rotate the three.js camera using the mouse, so will work on a desktop or laptop.</li>
</ol>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/04-api-communication/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ locar.on("gpsupdate", async(pos, distMoved) => {
);

locar.add(mesh, poi.geometry.coordinates[0], poi.geometry.coordinates[1], 0, poi.properties);
indexedObjects[poi.osm_id] = mesh;
indexedObjects[poi.properties.osm_id] = mesh;
}
});
firstPosition = false;
Expand Down

0 comments on commit 069774d

Please sign in to comment.