Index: ../trunk-jpl/src/m/plot/googlemaps.m =================================================================== --- ../trunk-jpl/src/m/plot/googlemaps.m (revision 15205) +++ ../trunk-jpl/src/m/plot/googlemaps.m (revision 15206) @@ -80,17 +80,17 @@ rows = ceil(dy/maxsize); %calculate pixel dimensions of each small image -bottom = 120; -largura = ceil(dx/cols); -altura = ceil(dy/rows); -alturaplus = altura + bottom; +bottom = 100; +width = ceil(dx/cols); +height = ceil(dy/rows); +heightplus = height + bottom; %Initialize final image final = zeros(floor(dy),floor(dx),3);%RGB image for x=0:cols-1, for y=0:rows-1, - dxn = largura * (0.5 + x); - dyn = altura * (0.5 + y); + dxn = width * (0.5 + x); + dyn = height * (0.5 + y); [latn, lonn] = pixelstolatlon(ulx + dxn, uly - dyn - bottom/2, zoom); position = [num2str(latn) ',' num2str(lonn)]; disp(['Google Earth tile: ' num2str(x) '/' num2str(cols-1) ' ' num2str(y) '/' num2str(rows-1) ' (center: ' position ')']); @@ -98,17 +98,19 @@ params = [... 'center=' position ... '&zoom=' num2str(zoom)... - '&size=' num2str(largura) 'x' num2str(alturaplus)... + '&size=' num2str(width) 'x' num2str(heightplus)... '&maptype=satellite'... '&sensor=false'... '&scale=' num2str(scale)]; url = ['http://maps.google.com/maps/api/staticmap?' params]; [X, map]=imread(url,'png'); X=ind2rgb(X,map); - indx1 = floor(x*largura)+1; - indx2 = min(floor(dx),floor(x*largura)+size(X,2)); - indy1 = floor(y*altura)+1; - indy2 = min(floor(dy),floor(y*altura)+size(X,1)); + indx1 = floor(x*width)+1; + indx2 = min(floor(dx),floor(x*width)+size(X,2)); + indy1 = floor(y*height)+1; + [floor(dy),floor(y*height)+size(X,1)] + [height heightplus] + indy2 = min(floor(dy),floor(y*height)+size(X,1)); final(indy1:indy2,indx1:indx2,:)=X(1:indy2-indy1+1,1:indx2-indx1+1,:); end end