File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -36,25 +36,34 @@ void QgsTileScaleWidget::layerChanged( QgsMapLayer *layer )
36
36
{
37
37
QgsRasterLayer *rl = qobject_cast<QgsRasterLayer *>( layer );
38
38
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 )
45
50
{
46
- QString uri = rl-> publicSource () .mid ( rl-> publicSource (). indexOf ( " tiled= " ) + 6 );
51
+ uri = uri .mid ( tiledpos + 6 );
47
52
int pos = uri.indexOf ( " ," );
48
53
if ( pos >= 0 )
49
54
uri = uri.left ( pos );
50
55
QStringList params = uri.split ( " ;" );
56
+ if ( params.size () < 3 )
57
+ return ;
51
58
52
59
params.takeFirst ();
53
60
params.takeFirst ();
54
61
55
62
mResolutions .clear ();
56
63
foreach ( QString r, params )
57
- mResolutions << r.toDouble ();
64
+ {
65
+ mResolutions << r.toDouble ();
66
+ }
58
67
qSort ( mResolutions );
59
68
60
69
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 )
363
363
364
364
bool QgsRasterProjector::calcCol ( int theCol )
365
365
{
366
- QgsDebugMsg ( QString ( " theCol = %1" ).arg ( theCol ) );
366
+ QgsDebugMsgLevel ( QString ( " theCol = %1" ).arg ( theCol ), 3 );
367
367
for ( int i = 0 ; i < mCPRows ; i++ )
368
368
{
369
369
calcCP ( i, theCol );
You can’t perform that action at this time.
0 commit comments