Skip to content

Commit 42b2a6b

Browse files
author
jef
committedMar 14, 2011
fix #3608
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15472 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed
 

‎src/app/qgstilescalewidget.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,34 @@ void QgsTileScaleWidget::layerChanged( QgsMapLayer *layer )
3636
{
3737
QgsRasterLayer *rl = qobject_cast<QgsRasterLayer *>( layer );
3838

39-
if ( !rl || rl->providerKey() != "wms" || !rl->publicSource().contains( "tiled=" ) )
40-
{
41-
mResolutions.clear();
42-
mSlider->setDisabled( true );
43-
}
44-
else
39+
mResolutions.clear();
40+
mSlider->setDisabled( true );
41+
42+
if ( !rl || rl->providerKey() != "wms" )
43+
return;
44+
45+
QString uri = rl->source();
46+
int tiledpos = uri.indexOf( "tiled=" );
47+
int urlpos = uri.indexOf( "url=" );
48+
49+
if ( tiledpos >= 0 && urlpos >= 0 && urlpos > tiledpos )
4550
{
46-
QString uri = rl->publicSource().mid( rl->publicSource().indexOf( "tiled=" ) + 6 );
51+
uri = uri.mid( tiledpos + 6 );
4752
int pos = uri.indexOf( "," );
4853
if ( pos >= 0 )
4954
uri = uri.left( pos );
5055
QStringList params = uri.split( ";" );
56+
if ( params.size() < 3 )
57+
return;
5158

5259
params.takeFirst();
5360
params.takeFirst();
5461

5562
mResolutions.clear();
5663
foreach( QString r, params )
57-
mResolutions << r.toDouble();
64+
{
65+
mResolutions << r.toDouble();
66+
}
5867
qSort( mResolutions );
5968

6069
for ( int i = 0; i < mResolutions.size(); i++ )

‎src/core/qgsrasterprojector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ bool QgsRasterProjector::calcRow( int theRow )
363363

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

0 commit comments

Comments
 (0)
Please sign in to comment.