Hi,

Openviews currently displays an empty map, when the views result is empty. Is this a bug or the expected behaviour? I was surprised by this behaviour.

Maybe a configuration option would be better.

Otherwise if someone else encounters the same problem:

Index: modules/openlayers_views/views/openlayers_views.views.inc
===================================================================
--- modules/openlayers_views/views/openlayers_views.views.inc   (Revision 592)
+++ modules/openlayers_views/views/openlayers_views.views.inc   (Arbeitskopie)
@@ -28,8 +28,8 @@
         'uses options' => TRUE,
                    'uses grouping' => TRUE,
         'type' => 'normal',
-        'even empty' => TRUE,
+        'even empty' => FALSE,
       ),
     ),
   );
CommentFileSizeAuthor
#12 HideEmptyMapDefault.patch960 bytesstrk

Comments

tmcw’s picture

Personally I prefer the map to display even when the views result is empty, because the map may not have any markers intended to be on it, but rather other layers. Heck, this is how I do everything... I set an impossible filter on the view (like, time == -1) to prevent OpenLayers from creating any markers, and then add KML layers generated by Drupal and WMS, WMS-C layers, etc.

Although if a different default is easy enough to override that's all right.

zzolo’s picture

Ideally this should an option for the user. I agree with tmcw, I would almost always want at least an empty map, but i can see the case for no map at all. It should not be forced. I imagine we can make an option in the plugin, then change the view accordingly?

zzolo’s picture

Status: Active » Fixed

http://drupal.org/cvs?commit=297006

Added option. Default is still to display empty map. Feel free to test.

Anonymous’s picture

Priority: Minor » Normal
Status: Fixed » Active

I don't mind having an empty map, however mine always zooms right in so all you see is water... Any way to stop this?

Back to the feature request... For users that tick the 'Do Not Display Empty Map' checkbox, it should instead display the views' 'Empty text' (if any).
By default this doesn't work (i.e. entering 'Empty text' and ticking 'Do Not Display Empty Map' results in no map and no empty text)...

zzolo’s picture

I looked at this for a while and could not figure out how to get the "Empty Text" from the view in a consistent way. Help?

Anonymous’s picture

I don't mind having an empty map, however mine always zooms right in so all you see is water... Any way to stop this?

I believe this has now been fixed: http://drupal.org/cvs?commit=303626

tmcw’s picture

Status: Active » Fixed

Assuming this is fixed?

zzolo’s picture

Actually, no. I spent a long time trying to figure out what method or property correctly retrieved the empty text attribute for the given view/display but to no avail. (unless someone fixed it and committed without telling anyone)

phayes’s picture

Can't we review the features array to do this? I don't think we are adding any empty features, so can't we just do a count?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

strk’s picture

Status: Closed (fixed) » Needs review

It seems to me that this behaviour is coming up enabled by default or something.
And when enabled the CCK widget breaks (is not shown) even if layers are available.
Can anyone confirm ?

strk’s picture

StatusFileSize
new960 bytes

The attached patch fixes the default "Hide empty map" option so to be false when unselected.
The CCK problem still remains if the options is turned on.

strk’s picture

Status: Needs review » Fixed

The patch was committed. Dunno how to find a link to the specific commit, but it's in 6--2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.