@@ -594,17 +594,8 @@ int msLayerIsVisible(mapObj *map, layerObj *layer)
594
594
if (layer -> type == MS_LAYER_QUERY || layer -> type == MS_LAYER_TILEINDEX ) return (MS_FALSE );
595
595
if ((layer -> status != MS_ON ) && (layer -> status != MS_DEFAULT )) return (MS_FALSE );
596
596
597
- /* Only return MS_FALSE if it is definitely false. Sometimes it will return MS_UNKNOWN, which we
598
- ** consider true, for this use case (it might be visible, try and draw it, see what happens). */
599
- if ( msExtentsOverlap (map , layer ) == MS_FALSE ) {
600
- if ( layer -> debug >= MS_DEBUGLEVEL_V ) {
601
- msDebug ("msLayerIsVisible(): Skipping layer (%s) because LAYER.EXTENT does not intersect MAP.EXTENT\n" , layer -> name );
602
- }
603
- return (MS_FALSE );
604
- }
605
-
606
- if (msEvalContext (map , layer , layer -> requires ) == MS_FALSE ) return (MS_FALSE );
607
-
597
+ /* Do comparisons of layer scale vs map scale now, since msExtentsOverlap() */
598
+ /* can be slow */
608
599
if (map -> scaledenom > 0 ) {
609
600
610
601
/* layer scale boundaries should be checked first */
@@ -614,13 +605,27 @@ int msLayerIsVisible(mapObj *map, layerObj *layer)
614
605
}
615
606
return (MS_FALSE );
616
607
}
617
- if ((layer -> minscaledenom > 0 ) && (map -> scaledenom <= layer -> minscaledenom )) {
608
+ if (/* (layer->minscaledenom > 0) &&*/ (map -> scaledenom <= layer -> minscaledenom )) {
618
609
if ( layer -> debug >= MS_DEBUGLEVEL_V ) {
619
610
msDebug ("msLayerIsVisible(): Skipping layer (%s) because LAYER.MINSCALE is too large for this MAP scale\n" , layer -> name );
620
611
}
621
612
return (MS_FALSE );
622
613
}
623
-
614
+ }
615
+
616
+ /* Only return MS_FALSE if it is definitely false. Sometimes it will return MS_UNKNOWN, which we
617
+ ** consider true, for this use case (it might be visible, try and draw it, see what happens). */
618
+ if ( msExtentsOverlap (map , layer ) == MS_FALSE ) {
619
+ if ( layer -> debug >= MS_DEBUGLEVEL_V ) {
620
+ msDebug ("msLayerIsVisible(): Skipping layer (%s) because LAYER.EXTENT does not intersect MAP.EXTENT\n" , layer -> name );
621
+ }
622
+ return (MS_FALSE );
623
+ }
624
+
625
+ if (msEvalContext (map , layer , layer -> requires ) == MS_FALSE ) return (MS_FALSE );
626
+
627
+ if (map -> scaledenom > 0 ) {
628
+
624
629
/* now check class scale boundaries (all layers *must* pass these tests) */
625
630
if (layer -> numclasses > 0 ) {
626
631
for (i = 0 ; i < layer -> numclasses ; i ++ ) {
0 commit comments