I have incorporated the google-maps-api-threejs-layer library into my project from this source. Now, I am looking to implement a picking feature.
Here is the modified code snippet:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Integrating Three.js Layer with Google Maps API</title>
<style>
html, body, #map-div {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="data.js"></script>
<script src="styles.js"></script>
<script src="../lib/detector.js"></script>
<script src="../lib/dat.gui.js"></script>
<script src="../lib/three.js"></script>
<script src="../threejs-layer.js"></script>
<script>
// JavaScript code including initialization and interaction with the threejs-layer library
</script>
</head>
<body>
<div id="map-div"></div>
</body>
</html>
Utilizing the raycaster to achieve a picking feature, I recommend checking the latest version of the three.js library here.
However, there is an issue when clicking near the geometries where elements outside the boxes are intersected. I am seeking a solution to restrict intersection to pixels inside the geometries on the map. Any suggestions on how to resolve this problem?
Update:
I have created a repository available at: https://github.com/FacundoGFlores/google-maps-api-threejs-layer