Skip to content

Commit

Permalink
fix #3608
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15472 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 14, 2011
1 parent a4e8e75 commit 94fc6a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
25 changes: 17 additions & 8 deletions src/app/qgstilescalewidget.cpp
Expand Up @@ -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++ )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrasterprojector.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 94fc6a0

Please sign in to comment.