File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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++ )
Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ bool QgsRasterProjector::calcRow( int theRow )
363363
364364bool 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 );
You can’t perform that action at this time.
0 commit comments