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,
),
),
);
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | HideEmptyMapDefault.patch | 960 bytes | strk |
Comments
Comment #1
tmcw commentedPersonally 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.
Comment #2
zzolo commentedIdeally 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?
Comment #3
zzolo commentedhttp://drupal.org/cvs?commit=297006
Added option. Default is still to display empty map. Feel free to test.
Comment #4
Anonymous (not verified) commentedI 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)...
Comment #5
zzolo commentedI 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?
Comment #6
Anonymous (not verified) commentedI believe this has now been fixed: http://drupal.org/cvs?commit=303626
Comment #7
tmcw commentedAssuming this is fixed?
Comment #8
zzolo commentedActually, 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)
Comment #9
phayes commentedCan'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?
Comment #11
strk commentedIt 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 ?
Comment #12
strk commentedThe 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.
Comment #13
strk commentedThe patch was committed. Dunno how to find a link to the specific commit, but it's in 6--2