Get 3D data from google earth.
This project is a combination of the amazing work from retroplasma/earth-reverse-engineering and LexSong/earth-reverse-engineering-utils put together to form a usable library.
yarn add https://github.com/AIFanatic/earth-3d
<script src="https://cdn.jsdelivr.net/gh/AIFAnatic/earth-3d@latest/dist/earth-3d-bundle.js"></script>
import { NodeManager } from 'https://cdn.jsdelivr.net/gh/AIFAnatic/earth-3d@latest/dist/earth-3d-esm-bundle.js';
import { NodeManager, LatLonBox } from 'earth-3d';
const filterLatLonBox = new LatLonBox(37.304420471191406, 37.3040771484375, -121.88644409179688, -121.88610076904297);
const nodeValidationHandler = (node) => {
// Filter nodes based on some criteria
return LatLonBox.is_overlapping(filterLatLonBox, node.latLonBox);
}
const nodeManager = new NodeManager({
nodeValidationHandler: nodeValidationHandler
});
setInterval(() => {
const nodes = nodeManager.get_nodes();
}, 100);
Notes:
nodeValidationHandler
method passes a NodeHeader
which contains the node LatLonBox and OBB, they can be used to filter nodes based on any criteria.ResourcesWorker.js
needs to be copied manually into your distribution directory.getNodes
is expected in order to retrieve all the nodes for a query.This project has no affiliation with Google or any of its affiliates, there may by a chance that you will get a temporary ban from using google maps services due to the high volume of tiles being streamed.