Skip to content
Permalink
Browse files

fix #3608

git-svn-id: http://svn.osgeo.org/qgis/trunk@15472 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 14, 2011
1 parent a4e8e75 commit 94fc6a008d61f5827c70b3bd423850416b960fe3
Showing with 18 additions and 9 deletions.
  1. +17 −8 src/app/qgstilescalewidget.cpp
  2. +1 −1 src/core/qgsrasterprojector.cpp
@@ -36,25 +36,34 @@ void QgsTileScaleWidget::layerChanged( QgsMapLayer *layer )
{
QgsRasterLayer *rl = qobject_cast<QgsRasterLayer *>( layer );

if ( !rl || rl->providerKey() != "wms" || !rl->publicSource().contains( "tiled=" ) )
{
mResolutions.clear();
mSlider->setDisabled( true );
}
else
mResolutions.clear();
mSlider->setDisabled( true );

if ( !rl || rl->providerKey() != "wms" )
return;

QString uri = rl->source();
int tiledpos = uri.indexOf( "tiled=" );
int urlpos = uri.indexOf( "url=" );

if ( tiledpos >= 0 && urlpos >= 0 && urlpos > tiledpos )
{
QString uri = rl->publicSource().mid( rl->publicSource().indexOf( "tiled=" ) + 6 );
uri = uri.mid( tiledpos + 6 );
int pos = uri.indexOf( "," );
if ( pos >= 0 )
uri = uri.left( pos );
QStringList params = uri.split( ";" );
if ( params.size() < 3 )
return;

params.takeFirst();
params.takeFirst();

mResolutions.clear();
foreach( QString r, params )
mResolutions << r.toDouble();
{
mResolutions << r.toDouble();
}
qSort( mResolutions );

for ( int i = 0; i < mResolutions.size(); i++ )
@@ -363,7 +363,7 @@ bool QgsRasterProjector::calcRow( int theRow )

bool QgsRasterProjector::calcCol( int theCol )
{
QgsDebugMsg( QString( "theCol = %1" ).arg( theCol ) );
QgsDebugMsgLevel( QString( "theCol = %1" ).arg( theCol ), 3 );
for ( int i = 0; i < mCPRows; i++ )
{
calcCP( i, theCol );

0 comments on commit 94fc6a0

Please sign in to comment.
You can’t perform that action at this time.