I need to display GPS routes on Google Earth using the Google Earth API. However, with approximately 20,000 points per route, the performance is not optimal. The code I have implemented successfully draws the tracks but struggles with rendering time and track disappearance issues.
var optimizeTrackDrawing = function(data) {
var trackPlacemark = ge.createPlacemark("");
var trackModel = ge.createLineString("");
trackPlacemark.setGeometry(trackModel);
ge.getFeatures().appendChild(trackPlacemark);
for (var i = 0; i < data.length; i++) {
trackModel.getCoordinates().pushLatLngAlt(data[i].lat,data[i].lng,data[i].alt);
}
}
I am looking for a solution to enhance the performance of this task, potentially through on-the-fly line simplification based on distance from the track. My previous experience with similar tasks on 2D Google Maps involved using Mourner's simplify.js and tile canvas engine.
Google Earth supposedly supports various detail levels for 3D models, allowing dynamic adjustments based on proximity. I envision dividing the space into cubic 3D tiles to vary polyline precision accordingly as the camera moves.
While Earth’s optimization mechanisms are opaque compared to Google Maps, any guidance, resources, or optimizations for the Google Earth plugin would be immensely helpful and appreciated.