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 iscell(guiprefs.aerial_file)
0031 [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0032 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0033 'Select Background File(s)',...
0034 'Multiselect', 'on',...
0035 fullfile(guiprefs.aerial_path,guiprefs.aerial_file{1}));
0036 else
0037 [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0038 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0039 'Select Background File(s)',...
0040 'Multiselect', 'on',...
0041 fullfile(guiprefs.aerial_path,guiprefs.aerial_file));
0042 end
0043 end
0044
0045 if ischar(guiprefs.aerial_file)
0046
0047 hdlmap = mapshow(fullfile(guiprefs.aerial_path,guiprefs.aerial_file)); hold on
0048 uistack(hdlmap,'bottom')
0049 log_text = vertcat({'Adding background image:'},guiprefs.aerial_file);
0050 set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0051 axis image on
0052 elseif iscell(guiprefs.aerial_file)
0053
0054 for i = 1:length(guiprefs.aerial_file);
0055 hdlmap = mapshow(fullfile(guiprefs.aerial_path,guiprefs.aerial_file{i})); hold on
0056 uistack(hdlmap,'bottom')
0057 log_text = vertcat({'Adding background image:'},guiprefs.aerial_file{i});
0058 end
0059 set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0060 axis image on
0061 end
0062
0063
0064
0065 ticks_format('%6.0f','%8.0f');
0066 hdlzm = zoom;
0067 set(hdlzm,'ActionPostCallback',@mypostcallback_zoom);
0068 set(hdlzm,'Enable','on');
0069 hdlpn = pan;
0070 set(hdlpn,'ActionPostCallback',@mypostcallback_pan);
0071 set(hdlpn,'Enable','on');
0072
0073
0074
0075 function mypostcallback_zoom(obj,evd)
0076 ticks_format('%6.0f','%8.0f');
0077
0078 function mypostcallback_pan(obj,evd)
0079 ticks_format('%6.0f','%8.0f');
0080
0081
0082
0083
0084