%% Customize Geographic Axes
% Customize the geographic axes of a geoplayer object by adding a custom line between route endpoints.
% Load a driving route and vehicle positions along that route.

data = load('geoRoute.mat');

%
% Create a geographic player that is centered on the first position of the vehicle.

zoomLevel = 10;
player = geoplayer(data.latitude(1),data.longitude(1),zoomLevel);

%
% Display the full route.

plotRoute(player,data.latitude,data.longitude);

%
% Display positions of the vehicle along the route.

for i = 1:length(data.latitude)
    plotPosition(player,data.latitude(i),data.longitude(i))
end

%
% Customize the geographic axes by adding a line between the two endpoints of the route.

geoplot(player.Axes,[data.latitude(1) data.latitude(end)], ...
    [data.longitude(1) data.longitude(end)],'g-*')

% Copyright 2018 The MathWorks, Inc.