0001 function [guiprefs,log_text] = VMT_OverlayDOQQ(guiprefs,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 if ~isempty(varargin)
0015 skip_ui = varargin{1};
0016 else
0017 skip_ui = false;
0018 end
0019
0020
0021 fig_planview_handle = findobj(0,'name','Plan View Map');
0022 if ~isempty(fig_planview_handle) && ishandle(fig_planview_handle)
0023 figure(fig_planview_handle);
0024 else
0025 fig_planview_handle = figure('name','Plan View Map'); clf
0026
0027 end
0028
0029 if ~skip_ui
0030 if exist('guiprefs','var') && isfield(guiprefs,'aerial_path')
0031 if iscell(guiprefs.aerial_file)
0032 [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0033 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0034 'Select Background File(s)',...
0035 'Multiselect', 'on',...
0036 fullfile(guiprefs.aerial_path,guiprefs.aerial_file{1}));
0037 else
0038 [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0039 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0040 'Select Background File(s)',...
0041 'Multiselect', 'on',...
0042 fullfile(guiprefs.aerial_path,guiprefs.aerial_file));
0043 end
0044 else
0045 [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0046 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0047 'Select Background File(s)',...
0048 'Multiselect', 'on',...
0049 pwd);
0050 end
0051 end
0052
0053 if ischar(guiprefs.aerial_file)
0054
0055 hdlmap = mapshow(fullfile(guiprefs.aerial_path,guiprefs.aerial_file)); hold on
0056 uistack(hdlmap,'bottom')
0057 log_text = vertcat({'Adding background image:'},guiprefs.aerial_file);
0058 set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0059 axis image on
0060 elseif iscell(guiprefs.aerial_file)
0061
0062 for i = 1:length(guiprefs.aerial_file);
0063 hdlmap = mapshow(fullfile(guiprefs.aerial_path,guiprefs.aerial_file{i})); hold on
0064 uistack(hdlmap,'bottom')
0065 log_text = vertcat({'Adding background image:'},guiprefs.aerial_file{i});
0066 end
0067 set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0068 axis image on
0069 end
0070
0071
0072
0073 ticks_format('%6.0f','%8.0f');
0074 hdlzm = zoom;
0075 set(hdlzm,'ActionPostCallback',@mypostcallback_zoom);
0076 set(hdlzm,'Enable','on');
0077 hdlpn = pan;
0078 set(hdlpn,'ActionPostCallback',@mypostcallback_pan);
0079 set(hdlpn,'Enable','on');
0080
0081
0082
0083 function mypostcallback_zoom(obj,evd)
0084 ticks_format('%6.0f','%8.0f');
0085
0086 function mypostcallback_pan(obj,evd)
0087 ticks_format('%6.0f','%8.0f');
0088
0089
0090
0091
0092