www.gusucode.com > map 案例源码 matlab代码程序 > map/WritePointDataToKMLUsingLookAtSpecifyViewExample.m

    %% Write Point Data to KML File Using LookAt to Specify View
% 
%%
% Specify the latitude, longitude, and altitude values that define a point.
% In this example, the location is the Machu Picchu ruins in Peru.
lat = -13.163111;
lon = -72.544945;
alt = 2430;
%%
% Create a geopoint object to specify the viewing options available through
% the |LookAt| parameter.
lookAt = geopoint(lat,lon);
lookAt.Range = 1500;
lookAt.Heading = 260;
lookAt.Tilt = 67;
name = 'LookAt location parameters';
%%
% Define the name of the KML file you want to create.
filename = 'Machu_Picchu.kml';
%%
% Write the point data to the file, using the |LookAt| parameter to specify
% the view.
kmlwritepoint(filename,lat,lon,alt,'Name',name,'LookAt',lookAt)