I am creating a KMZ file as output from my program (using SharpKML). How can I set the initial view so that when this file is opened in Google Earth it centres and zooms around my data?
When I open a KML file in GE this behaviour is by default, but when I open my KMZ the browser just opens to the default whole world view centred on users country. If I double click the main KML within my KMZ file, then I get the correct zoom and centering around my data. How can I make this happen automatically when Google Earth loads the KMZ?
Thanks.
If you add a LookAt or Camera to the first element in your root KML file (first .kml file within your KMZ) Google Earth will start at that location when that file is loaded.
If you have multiple features then add the
<LookAt>to the root-level Document.